Fix flaky test. (#4851)

This commit is contained in:
Florian Friemel 2019-03-08 15:15:40 +00:00 committed by josecoll
parent 785755067a
commit 65e7886168

View File

@ -47,6 +47,7 @@ import org.junit.Test
import org.junit.rules.ExpectedException
import org.junit.rules.ExternalResource
import java.time.Duration
import java.time.Instant
import java.time.LocalDate
import java.time.ZoneOffset
import java.time.temporal.ChronoUnit
@ -1609,7 +1610,12 @@ abstract class VaultQueryTestsBase : VaultQueryParties {
println("$index : $any")
}
assertThat(results.otherResults.size).isEqualTo(402)
assertThat(results.otherResults.last()).isEqualTo(200L)
val instants = results.otherResults.filter { it is Instant }.map { it as Instant }
assertThat(instants).isSorted
val longs = results.otherResults.filter { it is Long }.map { it as Long }
assertThat(longs.size).isEqualTo(201)
assertThat(instants.size).isEqualTo(201)
assertThat(longs.sum()).isEqualTo(20100L)
}
}