mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-18 12:40:52 +01:00
Add deleteBookmark() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
c6ad07f56f
commit
ca2ffc7279
@ -0,0 +1,33 @@
|
|||||||
|
package org.moire.ultrasonic.api.subsonic
|
||||||
|
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Integration test for [SubsonicAPIDefinition.deleteBookmark] call.
|
||||||
|
*/
|
||||||
|
class SubsonicApiDeleteBookmarkTest : SubsonicAPIClientTest() {
|
||||||
|
@Test
|
||||||
|
fun `Should handle error response`() {
|
||||||
|
checkErrorCallParsed(mockWebServerRule) {
|
||||||
|
client.api.deleteBookmark(1).execute()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `Should handle ok response`() {
|
||||||
|
mockWebServerRule.enqueueResponse("ping_ok.json")
|
||||||
|
|
||||||
|
val response = client.api.deleteBookmark(1).execute()
|
||||||
|
|
||||||
|
assertResponseSuccessful(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `Should pass id in request params`() {
|
||||||
|
val id = 233
|
||||||
|
|
||||||
|
mockWebServerRule.assertRequestParam(expectedParam = "id=$id") {
|
||||||
|
client.api.deleteBookmark(id).execute()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -230,4 +230,7 @@ interface SubsonicAPIDefinition {
|
|||||||
@Query("id") id: Int,
|
@Query("id") id: Int,
|
||||||
@Query("position") position: Long,
|
@Query("position") position: Long,
|
||||||
@Query("comment") comment: String? = null): Call<SubsonicResponse>
|
@Query("comment") comment: String? = null): Call<SubsonicResponse>
|
||||||
|
|
||||||
|
@GET("deleteBookmark.view")
|
||||||
|
fun deleteBookmark(@Query("id") id: Int): Call<SubsonicResponse>
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user