mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-05-16 07:16:34 +03:00
Add deletePlaylist() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
77833bf4d9
commit
e09476daea
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
@ -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>
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user