Skip to content

Commit

Permalink
Update wls-monitoring-service/src/test/java/de/muenchen/oss/wahllokal…
Browse files Browse the repository at this point in the history
…system/monitoringservice/client/waehleranzahl/WaehleranzahlClientMapperTest.java

Co-authored-by: MrSebastian <13592751+MrSebastian@users.noreply.github.com>
  • Loading branch information
dragonfly28 and MrSebastian authored Nov 4, 2024
1 parent 7fa07a6 commit 270fb0c
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,33 @@ void isMappedWithSomething() {
Assertions.assertThat(result).isEqualTo(expectedWahlbeteiligungsMeldungDTO);
}
}

@Nested
class LocalDateTimeToOffsetDateTime {

@Nested
class WithZoneIdWithDaylightSavingTime {

@Test
void should_useSummerSeasonOffset_when_mapping() {
val localDateTime = LocalDateTime.parse("2024-06-12T12:13:14.567");
val zoneID = ZoneId.of("Europe/Berlin");

val result = unitUnderTest.localDateTimeToOffsetDateTime(localDateTime, zoneID);

val expectedResult = OffsetDateTime.of(localDateTime, ZoneOffset.ofHours(2));
Assertions.assertThat(result).isEqualTo(expectedResult);
}

@Test
void should_useWinterSeasonOffset_when_mapping() {
val localDateTime = LocalDateTime.parse("2024-11-12T12:13:14.567");
val zoneID = ZoneId.of("Europe/Berlin");
val result = unitUnderTest.localDateTimeToOffsetDateTime(localDateTime, zoneID);

val expectedResult = OffsetDateTime.of(localDateTime, ZoneOffset.ofHours(1));
Assertions.assertThat(result).isEqualTo(expectedResult);
}
}
}
}

0 comments on commit 270fb0c

Please sign in to comment.