From 05b48bb9a2551f85acf876606938c59ae67d3ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20Sta=CC=88hli?= Date: Thu, 25 Apr 2024 14:49:54 +0200 Subject: [PATCH] Fix json test --- .../pillarbox/core/business/TestJsonSerialization.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/TestJsonSerialization.kt b/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/TestJsonSerialization.kt index 8e61f3158..e902920ba 100644 --- a/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/TestJsonSerialization.kt +++ b/pillarbox-core-business/src/test/java/ch/srgssr/pillarbox/core/business/TestJsonSerialization.kt @@ -16,7 +16,8 @@ import kotlin.test.assertNotNull class TestJsonSerialization { @Test fun testChapterValidJson() { - val json = "{\"urn\":\"urn:srf:video:12343\",\"title\":\"Chapter title\",\"imageUrl\":\"https://image.png\",\"blockReason\": \"UNKNOWN\"}" + val json = "{\"urn\":\"urn:srf:video:12343\",\"title\":\"Chapter title\",\"imageUrl\":\"https://image.png\",\"blockReason\": \"UNKNOWN\"," + + "\"mediaType\": \"VIDEO\"}" val chapter = jsonSerializer.decodeFromString(json) assertNotNull(chapter) assertEquals(BlockReason.UNKNOWN, chapter.blockReason) @@ -24,7 +25,8 @@ class TestJsonSerialization { @Test(expected = SerializationException::class) fun testChapterValidJsonUnknownBlockreason() { - val json = "{\"urn\":\"urn:srf:video:12343\",\"title\":\"Chapter title\",\"imageUrl\":\"https://image.png\",\"blockReason\": \"TOTO\"}" + val json = "{\"urn\":\"urn:srf:video:12343\",\"title\":\"Chapter title\",\"imageUrl\":\"https://image.png\",\"blockReason\": \"TOTO\"," + + "\"mediaType\": \"VIDEO\"}" val chapter = jsonSerializer.decodeFromString(json) assertNotNull(chapter) assertNotNull(chapter.blockReason) @@ -58,7 +60,8 @@ class TestJsonSerialization { { "urn": "urn:srf:video:12343", "title": "Chapter title", - "imageUrl": "https://image.png" + "imageUrl": "https://image.png", + "mediaType": "VIDEO" } ] }