Skip to content

Commit

Permalink
tests: unify sut use for nz
Browse files Browse the repository at this point in the history
  • Loading branch information
derTobsch committed Dec 6, 2024
1 parent 94ab9f1 commit 841326c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ void ensureToReturnCorrectClassNameWithCalendarPart() {
properties.setProperty("manager.impl", "managerImplClassName");
properties.setProperty("manager.impl.de", "managerImplClassNameDE");

final CalendarPartManagerParameter sut = new CalendarPartManagerParameter("de", properties);

assertThat(sut.getManagerImplClassName())
assertThat(new CalendarPartManagerParameter("de", properties).getManagerImplClassName())
.isEqualTo("managerImplClassNameDE");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@

class HolidayNZTest extends AbstractCountryTestBase {

private static final String ISO_CODE = "nz";
private static final Year YEAR = Year.of(2018);

private final HolidayManager holidayManager = HolidayManager.getInstance(create(NEW_ZEALAND));

@Test
void testManagerNZStructure() {
validateCalendarData(ISO_CODE, YEAR);
validateCalendarData("nz", Year.of(2018));
}

@Test
void testSouthlandAnniversary2011() {

final HolidayManager holidayManager = HolidayManager.getInstance(create(NEW_ZEALAND));

// Monday closest to 17 January
final LocalDate expected = LocalDate.of(2011, 1, 17);
final Set<Holiday> holidays = holidayManager.getHolidays(Year.of(2011), "stl");
Expand All @@ -42,6 +40,9 @@ void testSouthlandAnniversary2011() {

@Test
void testSouthlandAnniversary2012() {

final HolidayManager holidayManager = HolidayManager.getInstance(create(NEW_ZEALAND));

// Easter Tuesday
final LocalDate expected = LocalDate.of(2012, 4, 10);
final Set<Holiday> holidays = holidayManager.getHolidays(Year.of(2012), "stl");
Expand All @@ -53,7 +54,7 @@ void testSouthlandAnniversary2012() {

@Property
void ensuresThatQueenElisabethIIMemorialDayIsNotConfiguredUntil2021(@ForAll @YearRange(max = 2021) Year year) {
final HolidayManager holidayManager = HolidayManager.getInstance(create(ISO_CODE));
final HolidayManager holidayManager = HolidayManager.getInstance(create(NEW_ZEALAND));
final Set<Holiday> holidays = holidayManager.getHolidays(year);
assertThat(holidays)
.isNotEmpty()
Expand All @@ -62,7 +63,7 @@ void ensuresThatQueenElisabethIIMemorialDayIsNotConfiguredUntil2021(@ForAll @Yea

@Property
void ensuresThatQueenElisabethIIMemorialDayIsConfiguredIn2022(@ForAll @YearRange(min = 2022, max = 2022) Year year) {
final HolidayManager holidayManager = HolidayManager.getInstance(create(ISO_CODE));
final HolidayManager holidayManager = HolidayManager.getInstance(create(NEW_ZEALAND));
final Set<Holiday> holidays = holidayManager.getHolidays(year);
assertThat(holidays)
.isNotEmpty()
Expand All @@ -71,7 +72,7 @@ void ensuresThatQueenElisabethIIMemorialDayIsConfiguredIn2022(@ForAll @YearRange

@Property
void ensuresThatQueenElisabethIIMemorialDayIsConfiguredSince2023(@ForAll @YearRange(min = 2023) Year year) {
final HolidayManager holidayManager = HolidayManager.getInstance(create(ISO_CODE));
final HolidayManager holidayManager = HolidayManager.getInstance(create(NEW_ZEALAND));
final Set<Holiday> holidays = holidayManager.getHolidays(year);
assertThat(holidays)
.isNotEmpty()
Expand Down

0 comments on commit 841326c

Please sign in to comment.