Skip to content

Commit

Permalink
Merge pull request #687 from focus-shift/cleanups
Browse files Browse the repository at this point in the history
Test Cleanups
  • Loading branch information
derTobsch authored Dec 6, 2024
2 parents b0a76ec + 841326c commit 8289743
Show file tree
Hide file tree
Showing 3 changed files with 13 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 @@ -172,6 +172,8 @@ private static int getModulo(YearCycle cycle) {
case SIX_YEARS:
modulo = 6;
break;
default:
throw new IllegalStateException("Unexpected value: " + cycle);
}
return modulo;
}
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 8289743

Please sign in to comment.