mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-24 04:40:56 +03:00
Add deleteShare() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
fe12c440e7
commit
a1d5450515
@ -0,0 +1,33 @@
|
||||
package org.moire.ultrasonic.api.subsonic
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Integration test for [SubsonicAPIDefinition.deleteShare] call.
|
||||
*/
|
||||
class SubsonicApiDeleteShareTest : SubsonicAPIClientTest() {
|
||||
@Test
|
||||
fun `Should handle error response`() {
|
||||
checkErrorCallParsed(mockWebServerRule) {
|
||||
client.api.deleteShare(123).execute()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Should handle ok response`() {
|
||||
mockWebServerRule.enqueueResponse("ping_ok.json")
|
||||
|
||||
val response = client.api.deleteShare(12).execute()
|
||||
|
||||
assertResponseSuccessful(response)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Should pass id in request params`() {
|
||||
val id = 224L
|
||||
|
||||
mockWebServerRule.assertRequestParam(expectedParam = "id=$id") {
|
||||
client.api.deleteShare(id).execute()
|
||||
}
|
||||
}
|
||||
}
|
@ -204,6 +204,9 @@ interface SubsonicAPIDefinition {
|
||||
@Query("description") description: String? = null,
|
||||
@Query("expires") expires: Long? = null): Call<SharesResponse>
|
||||
|
||||
@GET("deleteShare.view")
|
||||
fun deleteShare(@Query("id") id: Long): Call<SubsonicResponse>
|
||||
|
||||
@GET("getGenres.view")
|
||||
fun getGenres(): Call<GenresResponse>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user