1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Fix WebfingerResponse tests

This commit is contained in:
Juan Carlos Garrote 2023-04-04 11:51:06 +02:00
parent 14baadd7ea
commit 3a27baad3a

View File

@ -22,20 +22,20 @@ class WebFingerResponseTest {
@Test @Test
fun `check rel in too much information - ok`() { fun `check rel in too much information - ok`() {
val response = loadResponses(TOO_MUCH_INFORMATION_JSON)!! val response = loadResponses(TOO_MUCH_INFORMATION_JSON)!!
Assert.assertEquals("https://gast.somedomain.de", response.links[0].href) Assert.assertEquals("https://gast.somedomain.de", response.links!![0].href)
Assert.assertEquals("http://webfinger.owncloud/rel/server-instance", response.links[0].rel) Assert.assertEquals("http://webfinger.owncloud/rel/server-instance", response.links!![0].rel)
} }
@Test(expected = JsonDataException::class) @Test(expected = JsonDataException::class)
fun `check key value pairs - ko - no href key`() { fun `check key value pairs - ko - no href key`() {
val response = loadResponses(BROKEN_JSON)!! val response = loadResponses(BROKEN_JSON)!!
Assert.assertEquals("https://gast.somedomain.de", response.links[0].href) Assert.assertEquals("https://gast.somedomain.de", response.links!![0].href)
} }
@Test(expected = JsonDataException::class) @Test(expected = JsonDataException::class)
fun `check key value pairs - ko - no rel key`() { fun `check key value pairs - ko - no rel key`() {
val response = loadResponses(BROKEN_JSON)!! val response = loadResponses(BROKEN_JSON)!!
Assert.assertEquals("https://gast.somedomain.de", response.links[0].href) Assert.assertEquals("https://gast.somedomain.de", response.links!![0].href)
} }
companion object { companion object {