mirror of
https://github.com/pcvolkmer/etl-processor.git
synced 2025-04-19 17:26:51 +00:00
test: use Europe/Berlin as timezone in tests
This commit is contained in:
parent
d4fd54f51f
commit
c0ea5fcd51
@ -54,6 +54,7 @@ import org.springframework.web.context.WebApplicationContext
|
|||||||
import reactor.core.publisher.Sinks
|
import reactor.core.publisher.Sinks
|
||||||
import reactor.test.StepVerifier
|
import reactor.test.StepVerifier
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
import java.time.ZoneId
|
||||||
import java.time.temporal.ChronoUnit
|
import java.time.temporal.ChronoUnit
|
||||||
|
|
||||||
|
|
||||||
@ -185,6 +186,7 @@ class StatisticsRestControllerTest {
|
|||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
fun setup() {
|
fun setup() {
|
||||||
|
val zoneId = ZoneId.of("Europe/Berlin")
|
||||||
doAnswer { _ ->
|
doAnswer { _ ->
|
||||||
listOf(
|
listOf(
|
||||||
Request(
|
Request(
|
||||||
@ -195,7 +197,7 @@ class StatisticsRestControllerTest {
|
|||||||
Fingerprint("0123456789abcdef1"),
|
Fingerprint("0123456789abcdef1"),
|
||||||
RequestType.MTB_FILE,
|
RequestType.MTB_FILE,
|
||||||
RequestStatus.SUCCESS,
|
RequestStatus.SUCCESS,
|
||||||
Instant.now().truncatedTo(ChronoUnit.DAYS).minus(2, ChronoUnit.DAYS)
|
Instant.now().atZone(zoneId).truncatedTo(ChronoUnit.DAYS).minus(2, ChronoUnit.DAYS).toInstant()
|
||||||
),
|
),
|
||||||
Request(
|
Request(
|
||||||
2,
|
2,
|
||||||
@ -205,7 +207,7 @@ class StatisticsRestControllerTest {
|
|||||||
Fingerprint("0123456789abcdef2"),
|
Fingerprint("0123456789abcdef2"),
|
||||||
RequestType.MTB_FILE,
|
RequestType.MTB_FILE,
|
||||||
RequestStatus.WARNING,
|
RequestStatus.WARNING,
|
||||||
Instant.now().truncatedTo(ChronoUnit.DAYS).minus(2, ChronoUnit.DAYS)
|
Instant.now().atZone(zoneId).truncatedTo(ChronoUnit.DAYS).minus(2, ChronoUnit.DAYS).toInstant()
|
||||||
),
|
),
|
||||||
Request(
|
Request(
|
||||||
3,
|
3,
|
||||||
@ -215,7 +217,7 @@ class StatisticsRestControllerTest {
|
|||||||
Fingerprint("0123456789abcdee1"),
|
Fingerprint("0123456789abcdee1"),
|
||||||
RequestType.DELETE,
|
RequestType.DELETE,
|
||||||
RequestStatus.ERROR,
|
RequestStatus.ERROR,
|
||||||
Instant.now().truncatedTo(ChronoUnit.DAYS).minus(1, ChronoUnit.DAYS)
|
Instant.now().atZone(zoneId).truncatedTo(ChronoUnit.DAYS).minus(1, ChronoUnit.DAYS).toInstant()
|
||||||
),
|
),
|
||||||
Request(
|
Request(
|
||||||
4,
|
4,
|
||||||
@ -225,7 +227,7 @@ class StatisticsRestControllerTest {
|
|||||||
Fingerprint("0123456789abcdef2"),
|
Fingerprint("0123456789abcdef2"),
|
||||||
RequestType.MTB_FILE,
|
RequestType.MTB_FILE,
|
||||||
RequestStatus.DUPLICATION,
|
RequestStatus.DUPLICATION,
|
||||||
Instant.now().truncatedTo(ChronoUnit.DAYS).minus(1, ChronoUnit.DAYS)
|
Instant.now().atZone(zoneId).truncatedTo(ChronoUnit.DAYS).minus(1, ChronoUnit.DAYS).toInstant()
|
||||||
),
|
),
|
||||||
Request(
|
Request(
|
||||||
5,
|
5,
|
||||||
@ -235,7 +237,7 @@ class StatisticsRestControllerTest {
|
|||||||
Fingerprint("0123456789abcdef2"),
|
Fingerprint("0123456789abcdef2"),
|
||||||
RequestType.DELETE,
|
RequestType.DELETE,
|
||||||
RequestStatus.UNKNOWN,
|
RequestStatus.UNKNOWN,
|
||||||
Instant.now().truncatedTo(ChronoUnit.DAYS)
|
Instant.now().atZone(zoneId).truncatedTo(ChronoUnit.DAYS).toInstant()
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}.whenever(requestService).findAll()
|
}.whenever(requestService).findAll()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user