mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-01-30 17:04:51 +01:00
Change Share id type to String.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
9cb6a5c4e9
commit
ad20064d79
@ -28,7 +28,7 @@ class SubsonicApiCreateShareTest : SubsonicAPIClientTest() {
|
||||
assertResponseSuccessful(response)
|
||||
response.body().shares.size `should equal to` 1
|
||||
with(response.body().shares[0]) {
|
||||
id `should equal to` 0
|
||||
id `should equal to` "0"
|
||||
url `should equal to` "https://subsonic.com/ext/share/awdwo?jwt=eyJhbGciOiJIUzI1NiJ9." +
|
||||
"eyJwYXRoIjoiL2V4dC9zaGFyZS9hd2R3byIsImV4cCI6MTU0MTYyNjQzMX0.iy8dkt_ZZc8hJ692" +
|
||||
"UxorHdHWFU2RB-fMCmCA4IJ_dTw"
|
||||
|
@ -27,7 +27,7 @@ class SubsonicApiGetSharesTest : SubsonicAPIClientTest() {
|
||||
assertResponseSuccessful(response)
|
||||
response.body().shares.size `should equal to` 1
|
||||
with(response.body().shares[0]) {
|
||||
id `should equal to` 0
|
||||
id `should equal to` "0"
|
||||
url `should equal to` "https://subsonic.com/ext/share/awdwo?jwt=eyJhbGciOiJIUzI1" +
|
||||
"NiJ9.eyJwYXRoIjoiL2V4dC9zaGFyZS9hd2R3byIsImV4cCI6MTU0MTYyNjQzMX0.iy8dkt_ZZc8" +
|
||||
"hJ692UxorHdHWFU2RB-fMCmCA4IJ_dTw"
|
||||
|
@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import java.util.Calendar
|
||||
|
||||
data class Share(
|
||||
val id: Long = -1L,
|
||||
val id: String = "",
|
||||
val url: String = "",
|
||||
val username: String = "",
|
||||
val created: Calendar? = null,
|
||||
|
@ -17,7 +17,7 @@ fun APIShare.toDomainEntity(): Share = Share().apply {
|
||||
created = this@toDomainEntity.created?.let { shareTimeFormat.format(it.time) }
|
||||
description = this@toDomainEntity.description
|
||||
expires = this@toDomainEntity.expires?.let { shareTimeFormat.format(it.time) }
|
||||
id = this@toDomainEntity.id.toString()
|
||||
id = this@toDomainEntity.id
|
||||
lastVisited = this@toDomainEntity.lastVisited?.let { shareTimeFormat.format(it.time) }
|
||||
url = this@toDomainEntity.url
|
||||
username = this@toDomainEntity.username
|
||||
|
@ -20,7 +20,7 @@ class APIShareConverterTest {
|
||||
val domainEntity = entity.toDomainEntity()
|
||||
|
||||
with(domainEntity) {
|
||||
id `should equal to` entity.id.toString()
|
||||
id `should equal to` entity.id
|
||||
url `should equal to` entity.url
|
||||
description `should equal to` entity.description
|
||||
username `should equal to` entity.username
|
||||
@ -33,7 +33,7 @@ class APIShareConverterTest {
|
||||
}
|
||||
|
||||
private fun createFakeShare(): Share {
|
||||
return Share(id = 45L, url = "some-long-url", username = "Bender",
|
||||
return Share(id = "45", url = "some-long-url", username = "Bender",
|
||||
created = Calendar.getInstance(), expires = Calendar.getInstance(), visitCount = 24,
|
||||
description = "Kiss my shiny metal ass", lastVisited = Calendar.getInstance(),
|
||||
items = listOf(MusicDirectoryChild()))
|
||||
@ -43,7 +43,7 @@ class APIShareConverterTest {
|
||||
fun `Should parse list of shares into domain entity list`() {
|
||||
val entityList = listOf(
|
||||
createFakeShare(),
|
||||
createFakeShare().copy(id = 554L, lastVisited = null))
|
||||
createFakeShare().copy(id = "554", lastVisited = null))
|
||||
|
||||
val domainEntityList = entityList.toDomainEntitiesList()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user