From a177e5700c56683a6042c6a15ab369ba8584b658 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 28 Jun 2022 17:43:26 +0800 Subject: [PATCH] test: fix type inference because of latest assertj --- .../komga/domain/service/MetadataApplierTest.kt | 4 ++-- .../komga/infrastructure/jooq/MediaDaoTest.kt | 4 ++-- .../komga/infrastructure/jooq/ReadListDaoTest.kt | 16 ++++++++-------- .../metadata/comicrack/ComicInfoProviderTest.kt | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/komga/src/test/kotlin/org/gotson/komga/domain/service/MetadataApplierTest.kt b/komga/src/test/kotlin/org/gotson/komga/domain/service/MetadataApplierTest.kt index 7e0ac1f3..f31b8632 100644 --- a/komga/src/test/kotlin/org/gotson/komga/domain/service/MetadataApplierTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/domain/service/MetadataApplierTest.kt @@ -100,7 +100,7 @@ class MetadataApplierTest { .containsExactlyInAnyOrder( WebLink("Comixology", URI("https://www.comixology.com/Sandman/digital-comic/727888")), ) - assertThat(patched.tags) + assertThat(patched.tags as Iterable) .hasSize(2) .containsExactlyInAnyOrder("tag1", "tag2") } @@ -186,7 +186,7 @@ class MetadataApplierTest { assertThat(patched.ageRating).isEqualTo(patch.ageRating) assertThat(patched.language).isEqualTo(patch.language) assertThat(patched.totalBookCount).isEqualTo(patch.totalBookCount) - assertThat(patched.genres) + assertThat(patched.genres as Iterable) .hasSize(1) .containsExactlyInAnyOrder("shonen") assertThat(patched.tags).isEmpty() diff --git a/komga/src/test/kotlin/org/gotson/komga/infrastructure/jooq/MediaDaoTest.kt b/komga/src/test/kotlin/org/gotson/komga/infrastructure/jooq/MediaDaoTest.kt index 2b1c799b..cfbfa44b 100644 --- a/komga/src/test/kotlin/org/gotson/komga/infrastructure/jooq/MediaDaoTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/infrastructure/jooq/MediaDaoTest.kt @@ -221,7 +221,7 @@ class MediaDaoTest( val found = mediaDao.findAllBookAndSeriesIdsByLibraryIdAndMediaTypeAndWithMissingPageHash(book.libraryId, listOf(MediaType.ZIP.value), komgaProperties.pageHashing) - assertThat(found) + assertThat(found as Iterable>) .hasSize(1) .containsOnly(Pair(book.id, book.seriesId)) } @@ -263,7 +263,7 @@ class MediaDaoTest( val found = mediaDao.findAllBookAndSeriesIdsByLibraryIdAndMediaTypeAndWithMissingPageHash(book.libraryId, listOf(MediaType.ZIP.value), komgaProperties.pageHashing) - assertThat(found) + assertThat(found as Iterable>) .hasSize(1) .containsOnly(Pair(book.id, book.seriesId)) } diff --git a/komga/src/test/kotlin/org/gotson/komga/infrastructure/jooq/ReadListDaoTest.kt b/komga/src/test/kotlin/org/gotson/komga/infrastructure/jooq/ReadListDaoTest.kt index 3cd5c228..85523355 100644 --- a/komga/src/test/kotlin/org/gotson/komga/infrastructure/jooq/ReadListDaoTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/infrastructure/jooq/ReadListDaoTest.kt @@ -110,7 +110,7 @@ class ReadListDaoTest( assertThat(updated.summary).isEqualTo(updatedReadList.summary) assertThat(updated.createdDate).isNotEqualTo(updated.lastModifiedDate) assertThat(updated.lastModifiedDate).isCloseTo(now, offset) - assertThat(updated.bookIds.values) + assertThat(updated.bookIds.values as Iterable) .hasSize(5) .containsExactlyElementsOf(books.map { it.id }.take(5)) } @@ -140,12 +140,12 @@ class ReadListDaoTest( // then val rl1 = readListDao.findByIdOrNull(readList1.id)!! - assertThat(rl1.bookIds.values) + assertThat(rl1.bookIds.values as Iterable) .hasSize(9) .doesNotContain(books.first().id) val col2 = readListDao.findByIdOrNull(readList2.id)!! - assertThat(col2.bookIds.values) + assertThat(col2.bookIds.values as Iterable) .hasSize(4) .doesNotContain(books.first().id) } @@ -190,7 +190,7 @@ class ReadListDaoTest( assertThat(foundLibrary1Filtered).hasSize(2) assertThat(foundLibrary1Filtered.map { it.name }).containsExactly("readListLibrary1", "readListLibraryBoth") with(foundLibrary1Filtered.find { it.name == "readListLibraryBoth" }!!) { - assertThat(bookIds.values) + assertThat(bookIds.values as Iterable) .hasSize(1) .containsExactly(bookLibrary1.id) assertThat(filtered).isTrue @@ -199,7 +199,7 @@ class ReadListDaoTest( assertThat(foundLibrary1Unfiltered).hasSize(2) assertThat(foundLibrary1Unfiltered.map { it.name }).containsExactly("readListLibrary1", "readListLibraryBoth") with(foundLibrary1Unfiltered.find { it.name == "readListLibraryBoth" }!!) { - assertThat(bookIds.values) + assertThat(bookIds.values as Iterable) .hasSize(2) .containsExactly(bookLibrary1.id, bookLibrary2.id) assertThat(filtered).isFalse @@ -208,7 +208,7 @@ class ReadListDaoTest( assertThat(foundLibrary2Filtered).hasSize(2) assertThat(foundLibrary2Filtered.map { it.name }).containsExactly("readListLibrary2", "readListLibraryBoth") with(foundLibrary2Filtered.find { it.name == "readListLibraryBoth" }!!) { - assertThat(bookIds.values) + assertThat(bookIds.values as Iterable) .hasSize(1) .containsExactly(bookLibrary2.id) assertThat(filtered).isTrue @@ -217,7 +217,7 @@ class ReadListDaoTest( assertThat(foundLibrary2Unfiltered).hasSize(2) assertThat(foundLibrary2Unfiltered.map { it.name }).containsExactly("readListLibrary2", "readListLibraryBoth") with(foundLibrary2Unfiltered.find { it.name == "readListLibraryBoth" }!!) { - assertThat(bookIds.values) + assertThat(bookIds.values as Iterable) .hasSize(2) .containsExactly(bookLibrary1.id, bookLibrary2.id) assertThat(filtered).isFalse @@ -226,7 +226,7 @@ class ReadListDaoTest( assertThat(foundBothUnfiltered).hasSize(3) assertThat(foundBothUnfiltered.map { it.name }).containsExactly("readListLibrary1", "readListLibrary2", "readListLibraryBoth") with(foundBothUnfiltered.find { it.name == "readListLibraryBoth" }!!) { - assertThat(bookIds.values) + assertThat(bookIds.values as Iterable) .hasSize(2) .containsExactly(bookLibrary1.id, bookLibrary2.id) assertThat(filtered).isFalse diff --git a/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/comicrack/ComicInfoProviderTest.kt b/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/comicrack/ComicInfoProviderTest.kt index 5f054218..981f455b 100644 --- a/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/comicrack/ComicInfoProviderTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/comicrack/ComicInfoProviderTest.kt @@ -83,7 +83,7 @@ class ComicInfoProviderTest { WebLink("www.comixology.com", URI("https://www.comixology.com/Sandman/digital-comic/727888")), ) - assertThat(tags) + assertThat(tags as Iterable) .hasSize(2) .containsExactlyInAnyOrder("dark", "occult") }