test: fix warnings and failing test on CI

This commit is contained in:
Gauthier Roebroeck 2021-09-14 14:06:06 +08:00
parent 92059518cb
commit 7fe94143f1
4 changed files with 5 additions and 5 deletions

View file

@ -119,7 +119,7 @@ class ReadProgressDaoTest(
assertThat(page).isEqualTo(10)
assertThat(completed).isEqualTo(true)
assertThat(bookId).isEqualTo(book1.id)
assertThat(readDate).isEqualTo(readDateInThePast)
assertThat(readDate).isEqualToIgnoringNanos(readDateInThePast)
assertThat(createdDate)
.isBefore(modificationDate)
.isNotEqualTo(lastModifiedDate)

View file

@ -650,7 +650,7 @@ class SeriesDtoDaoTest(
@Test
fun `given series when searching by deleted then results are matched`() {
// given
val series = seriesLifecycle.createSeries(makeSeries("Batman", library.id).copy(deletedDate = LocalDateTime.now()))
seriesLifecycle.createSeries(makeSeries("Batman", library.id).copy(deletedDate = LocalDateTime.now()))
seriesLifecycle.createSeries(makeSeries("Batman and Robin", library.id))
searchIndexLifecycle.rebuildIndex()

View file

@ -9,10 +9,10 @@ class MultilingualAnalyzerTest {
private val analyzer = MultiLingualAnalyzer()
private fun Analyzer.getTokens(text: String): List<String> {
val ts = tokenStream("text", text)
val tokenStream = tokenStream("text", text)
val tokens = mutableListOf<String>()
ts.use { ts ->
tokenStream.use { ts ->
ts.reset()
while (ts.incrementToken()) {
ts.reflectWith { _, key, value -> if (key == "term") tokens += value.toString() }

View file

@ -350,7 +350,7 @@ class BookControllerTest(
val book1 = makeBook("1", libraryId = library.id)
val book2 = makeBook("2", libraryId = library.id)
val book3 = makeBook("3", libraryId = library.id)
val series = makeSeries(name = "series", libraryId = library.id).let { series ->
makeSeries(name = "series", libraryId = library.id).let { series ->
seriesLifecycle.createSeries(series).also { created ->
val books = listOf(book1, book2, book3)
seriesLifecycle.addBooks(created, books)