Add deletePlaylist() call.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
Yahor Berdnikau 2017-09-02 21:07:19 +02:00
parent 77833bf4d9
commit e09476daea
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package org.moire.ultrasonic.api.subsonic
import org.junit.Test
/**
* Instrumentation test for [SubsonicAPIClient] for deletePlaylist call.
*/
class SubsonicApiDeletePlaylistTest : SubsonicAPIClientTest() {
@Test
fun `Should handle error response`() {
checkErrorCallParsed(mockWebServerRule) {
client.api.deletePlaylist(10).execute()
}
}
@Test
fun `Should handle ok response`() {
mockWebServerRule.enqueueResponse("ping_ok.json")
val response = client.api.deletePlaylist(10).execute()
assertResponseSuccessful(response)
}
@Test
fun `Should pass id param in request`() {
val id = 534L
mockWebServerRule.assertRequestParam(responseResourceName = "ping_ok.json",
expectedParam = "id=$id") {
client.api.deletePlaylist(id).execute()
}
}
}

View File

@ -96,4 +96,7 @@ interface SubsonicAPIDefinition {
fun createPlaylist(@Query("playlistId") id: Long? = null,
@Query("name") name: String? = null,
@Query("songId") songIds: List<Long>? = null): Call<SubsonicResponse>
@GET("deletePlaylist.view")
fun deletePlaylist(@Query("id") id: Long): Call<SubsonicResponse>
}