diff --git a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/BookControllerTest.kt b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/BookControllerTest.kt index 03131ee29..f33a64de6 100644 --- a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/BookControllerTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/BookControllerTest.kt @@ -930,6 +930,7 @@ class BookControllerTest( val bookId = bookRepository.findAll().first().id + // language=JSON val jsonString = """ { "title":"newTitle", @@ -1015,6 +1016,7 @@ class BookControllerTest( bookMetadataRepository.update(updated) } + // language=JSON val jsonString = """ { "summary":"", @@ -1067,6 +1069,7 @@ class BookControllerTest( assertThat(releaseDate).isEqualTo(testDate) } + // language=JSON val jsonString = """ { "authors":null, @@ -1123,6 +1126,7 @@ class BookControllerTest( bookMetadataRepository.update(updated) } + // language=JSON val jsonString = """ { } @@ -1189,6 +1193,7 @@ class BookControllerTest( ) } + // language=JSON val jsonString = """ { "page": 5 @@ -1230,6 +1235,7 @@ class BookControllerTest( ) } + // language=JSON val jsonString = """ { "completed": true @@ -1271,6 +1277,7 @@ class BookControllerTest( ) } + // language=JSON val jsonString = """ { "page": 5, @@ -1318,6 +1325,7 @@ class BookControllerTest( ) } + // language=JSON val jsonString = """ { "completed": true diff --git a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/LibraryControllerTest.kt b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/LibraryControllerTest.kt index ceb331a61..c16908245 100644 --- a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/LibraryControllerTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/LibraryControllerTest.kt @@ -55,6 +55,7 @@ class LibraryControllerTest( @Test @WithAnonymousUser fun `given anonymous user when addOne then return unauthorized`() { + // language=JSON val jsonString = """{"name":"test", "root": "C:\\Temp"}""" mockMvc.post(route) { @@ -76,6 +77,7 @@ class LibraryControllerTest( @Test @WithMockUser(roles = [ROLE_USER]) fun `given user with USER role when addOne then return forbidden`() { + // language=JSON val jsonString = """{"name":"test", "root": "C:\\Temp"}""" mockMvc.post(route) { diff --git a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/ReadListControllerTest.kt b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/ReadListControllerTest.kt index 558a46a07..439e855f0 100644 --- a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/ReadListControllerTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/ReadListControllerTest.kt @@ -832,6 +832,7 @@ class ReadListControllerTest( @Test @WithMockCustomUser fun `given non-admin user when creating read list then return forbidden`() { + // language=JSON val jsonString = """ {"name":"readlist","bookIds":["3"]} """.trimIndent() @@ -847,6 +848,7 @@ class ReadListControllerTest( @Test @WithMockCustomUser(roles = [ROLE_ADMIN]) fun `given admin user when creating read list then return ok`() { + // language=JSON val jsonString = """ {"name":"readlist","summary":"summary","bookIds":["${booksLibrary1.first().id}"]} """.trimIndent() @@ -867,6 +869,7 @@ class ReadListControllerTest( fun `given existing read lists when creating read list with existing name then return bad request`() { makeReadLists() + // language=JSON val jsonString = """ {"name":"Lib1","bookIds":["${booksLibrary1.first().id}"]} """.trimIndent() @@ -882,6 +885,7 @@ class ReadListControllerTest( @Test @WithMockCustomUser(roles = [ROLE_ADMIN]) fun `given read list with duplicate bookIds when creating read list then return bad request`() { + // language=JSON val jsonString = """ {"name":"Lib1","bookIds":["${booksLibrary1.first().id}","${booksLibrary1.first().id}"]} """.trimIndent() @@ -900,6 +904,7 @@ class ReadListControllerTest( @Test @WithMockCustomUser fun `given non-admin user when updating read list then return forbidden`() { + // language=JSON val jsonString = """ {"name":"readlist","bookIds":["3"]} """.trimIndent() @@ -917,6 +922,7 @@ class ReadListControllerTest( fun `given admin user when updating read list then return no content`() { makeReadLists() + // language=JSON val jsonString = """ {"name":"updated","summary":"updatedSummary","bookIds":["${booksLibrary1.first().id}"]} """.trimIndent() @@ -943,6 +949,7 @@ class ReadListControllerTest( fun `given existing read lists when updating read list with existing name then return bad request`() { makeReadLists() + // language=JSON val jsonString = """{"name":"Lib2"}""" mockMvc.patch("/api/v1/readlists/${rlLib1.id}") { @@ -958,6 +965,7 @@ class ReadListControllerTest( fun `given existing read list when updating read list with duplicate bookIds then return bad request`() { makeReadLists() + // language=JSON val jsonString = """{"bookIds":["${booksLibrary1.first().id}","${booksLibrary1.first().id}"]}""" mockMvc.patch("/api/v1/readlists/${rlLib1.id}") { diff --git a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/SeriesCollectionControllerTest.kt b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/SeriesCollectionControllerTest.kt index 876764c1d..7882675d7 100644 --- a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/SeriesCollectionControllerTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/SeriesCollectionControllerTest.kt @@ -721,6 +721,7 @@ class SeriesCollectionControllerTest( @Test @WithMockCustomUser fun `given non-admin user when creating collection then return forbidden`() { + // language=JSON val jsonString = """ {"name":"collection","ordered":false,"seriesIds":["3"]} """.trimIndent() @@ -736,6 +737,7 @@ class SeriesCollectionControllerTest( @Test @WithMockCustomUser(roles = [ROLE_ADMIN]) fun `given admin user when creating collection then return ok`() { + // language=JSON val jsonString = """ {"name":"collection","ordered":false,"seriesIds":["${seriesLibrary1.first().id}"]} """.trimIndent() @@ -756,6 +758,7 @@ class SeriesCollectionControllerTest( fun `given existing collections when creating collection with existing name then return bad request`() { makeCollections() + // language=JSON val jsonString = """ {"name":"Lib1","ordered":false,"seriesIds":["${seriesLibrary1.first().id}"]} """.trimIndent() @@ -771,6 +774,7 @@ class SeriesCollectionControllerTest( @Test @WithMockCustomUser(roles = [ROLE_ADMIN]) fun `given collection with duplicate seriesIds when creating collection then return bad request`() { + // language=JSON val jsonString = """ {"name":"Lib1","ordered":false,"seriesIds":["${seriesLibrary1.first().id}","${seriesLibrary1.first().id}"]} """.trimIndent() @@ -789,6 +793,7 @@ class SeriesCollectionControllerTest( @Test @WithMockCustomUser fun `given non-admin user when updating collection then return forbidden`() { + // language=JSON val jsonString = """ {"name":"collection","ordered":false,"seriesIds":["3"]} """.trimIndent() @@ -806,6 +811,7 @@ class SeriesCollectionControllerTest( fun `given admin user when updating collection then return no content`() { makeCollections() + // language=JSON val jsonString = """ {"name":"updated","ordered":true,"seriesIds":["${seriesLibrary1.first().id}"]} """.trimIndent() @@ -832,6 +838,7 @@ class SeriesCollectionControllerTest( fun `given existing collections when updating collection with existing name then return bad request`() { makeCollections() + // language=JSON val jsonString = """{"name":"Lib2"}""" mockMvc.patch("/api/v1/collections/${colLib1.id}") { @@ -847,6 +854,7 @@ class SeriesCollectionControllerTest( fun `given existing collection when updating collection with duplicate seriesIds then return bad request`() { makeCollections() + // language=JSON val jsonString = """{"seriesIds":["${seriesLibrary1.first().id}","${seriesLibrary1.first().id}"]}""" mockMvc.patch("/api/v1/collections/${colLib1.id}") { diff --git a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/SeriesControllerTest.kt b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/SeriesControllerTest.kt index b85cc0208..ce92a8ee2 100644 --- a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/SeriesControllerTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/SeriesControllerTest.kt @@ -742,6 +742,7 @@ class SeriesControllerTest( } } + // language=JSON val jsonString = """ { "title":"newTitle", @@ -833,6 +834,7 @@ class SeriesControllerTest( assertThat(genres).hasSize(1) } + // language=JSON val jsonString = """ { "readingDirection":null, diff --git a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/UserControllerDemoTest.kt b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/UserControllerDemoTest.kt index 4bb575937..02abb76aa 100644 --- a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/UserControllerDemoTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/UserControllerDemoTest.kt @@ -23,6 +23,7 @@ class UserControllerDemoTest( @Test @WithMockCustomUser fun `given demo profile is active when a user tries to update its password via api then returns forbidden`() { + // language=JSON val jsonString = """{"password":"new"}""" mockMvc.patch("/api/v2/users/me/password") { diff --git a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/UserControllerTest.kt b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/UserControllerTest.kt index ddcd5a0ca..bdd0a923c 100644 --- a/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/UserControllerTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/interfaces/api/rest/UserControllerTest.kt @@ -77,6 +77,7 @@ class UserControllerTest( @ValueSource(strings = ["user", "user@domain"]) @WithMockCustomUser(roles = [ROLE_ADMIN]) fun `when creating a user with invalid email then returns bad request`(email: String) { + // language=JSON val jsonString = """{"email":"$email","password":"password"}""" mockMvc.post("/api/v2/users") { @@ -95,6 +96,7 @@ class UserControllerTest( val user = KomgaUser("user@example.org", "", false, id = "user", roleFileDownload = false, rolePageStreaming = false) userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "roles": ["$ROLE_FILE_DOWNLOAD","$ROLE_PAGE_STREAMING"] @@ -124,6 +126,7 @@ class UserControllerTest( val user = KomgaUser("user@example.org", "", true, id = "user", roleFileDownload = true, rolePageStreaming = true) userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "roles": [] @@ -153,6 +156,7 @@ class UserControllerTest( val user = KomgaUser("user@example.org", "", false, id = "user", sharedAllLibraries = false, sharedLibrariesIds = setOf("1")) userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "sharedLibraries": { @@ -184,6 +188,7 @@ class UserControllerTest( val user = KomgaUser("user@example.org", "", false, id = "user", sharedAllLibraries = true) userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "sharedLibraries": { @@ -215,6 +220,7 @@ class UserControllerTest( val user = KomgaUser("user@example.org", "", false, id = "user", sharedAllLibraries = false, sharedLibrariesIds = setOf("2")) userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "sharedLibraries": { @@ -246,6 +252,7 @@ class UserControllerTest( val user = KomgaUser("user@example.org", "", false, id = "user") userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "labelsAllow": ["cute", "kids"], @@ -284,6 +291,7 @@ class UserControllerTest( ) userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "labelsAllow": [], @@ -313,6 +321,7 @@ class UserControllerTest( val user = KomgaUser("user@example.org", "", false, id = "user") userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "ageRestriction": { @@ -345,6 +354,7 @@ class UserControllerTest( val user = KomgaUser("user@example.org", "", false, id = "user") userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "ageRestriction": { @@ -376,6 +386,7 @@ class UserControllerTest( ) userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "ageRestriction": null @@ -411,6 +422,7 @@ class UserControllerTest( ) userLifecycle.createUser(user) + // language=JSON val jsonString = """ { "ageRestriction": {