Add deleteShare() call.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
Yahor Berdnikau 2017-11-19 14:36:41 +01:00
parent fe12c440e7
commit a1d5450515
2 changed files with 36 additions and 0 deletions

View File

@ -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()
}
}
}

View File

@ -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>