Skip to content

Commit

Permalink
Merge pull request #672 from focus-shift/671-tessin-peter-und-paul
Browse files Browse the repository at this point in the history
switzerland: peter and paul observance since 2021
  • Loading branch information
derTobsch authored Dec 4, 2024
2 parents d547336 + 4bf0c15 commit b701736
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion jollyday-core/src/main/resources/holidays/Holidays_ch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@
<Fixed month="JANUARY" day="6" descriptionPropertiesKey="EPIPHANY"/>
<Fixed month="MARCH" day="19" descriptionPropertiesKey="ST_JOSEPH" localizedType="OBSERVANCE"/>
<Fixed month="MAY" day="1" descriptionPropertiesKey="LABOUR_DAY" localizedType="OBSERVANCE"/>
<Fixed month="JUNE" day="29" descriptionPropertiesKey="ST_PETER_PAUL"/>
<Fixed month="JUNE" day="29" validTo="2020" descriptionPropertiesKey="ST_PETER_PAUL"/>
<Fixed month="JUNE" day="29" validFrom="2021" descriptionPropertiesKey="ST_PETER_PAUL" localizedType="OBSERVANCE"/>
<Fixed month="AUGUST" day="15" descriptionPropertiesKey="ASSUMPTION_DAY"/>
<Fixed month="NOVEMBER" day="1" descriptionPropertiesKey="ALL_SAINTS"/>
<Fixed month="DECEMBER" day="8" descriptionPropertiesKey="IMMACULATE_CONCEPTION"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Set;

import static de.focus_shift.jollyday.core.HolidayCalendar.SWITZERLAND;
import static de.focus_shift.jollyday.core.HolidayType.OBSERVANCE;
import static de.focus_shift.jollyday.core.HolidayType.PUBLIC_HOLIDAY;
import static de.focus_shift.jollyday.core.ManagerParameters.create;
import static java.time.Month.DECEMBER;
Expand Down Expand Up @@ -47,14 +48,23 @@ void ensuresThatStNicholasIsConfiguredInObwalden(@ForAll @YearRange(min = 1947)
}

@Property
void ensuresThatStPeterAndPaulIsConfiguredInTicino(@ForAll @YearRange Year year) {
void ensuresThatStPeterAndPaulIsConfiguredInTicinoAsPublicHolidayUntil2020(@ForAll @YearRange(max = 2020) Year year) {
final HolidayManager holidayManager = HolidayManager.getInstance(create(SWITZERLAND));
final Set<Holiday> holidays = holidayManager.getHolidays(year, "ti");
assertThat(holidays)
.isNotEmpty()
.contains(new Holiday(LocalDate.of(year.getValue(), JUNE, 29), "ST_PETER_PAUL", PUBLIC_HOLIDAY));
}

@Property
void ensuresThatStPeterAndPaulIsConfiguredInTicinoAsObservanceSince2021(@ForAll @YearRange(min = 2021) Year year) {
final HolidayManager holidayManager = HolidayManager.getInstance(create(SWITZERLAND));
final Set<Holiday> holidays = holidayManager.getHolidays(year, "ti");
assertThat(holidays)
.isNotEmpty()
.contains(new Holiday(LocalDate.of(year.getValue(), JUNE, 29), "ST_PETER_PAUL", OBSERVANCE));
}

@Property
void ensuresThatDayOfIndependenceIsConfiguredInJura(@ForAll @YearRange Year year) {
final HolidayManager holidayManager = HolidayManager.getInstance(create(SWITZERLAND));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
<Fixed month="JANUARY" day="6" descriptionPropertiesKey="EPIPHANY"/>
<Fixed month="MARCH" day="19" descriptionPropertiesKey="ST_JOSEPH" localizedType="OBSERVANCE"/>
<Fixed month="MAY" day="1" descriptionPropertiesKey="LABOUR_DAY" localizedType="OBSERVANCE"/>
<Fixed month="JUNE" day="29" descriptionPropertiesKey="ST_PETER_PAUL"/>
<Fixed month="JUNE" day="29" descriptionPropertiesKey="ST_PETER_PAUL" localizedType="OBSERVANCE"/>
<Fixed month="AUGUST" day="15" descriptionPropertiesKey="ASSUMPTION_DAY"/>
<Fixed month="NOVEMBER" day="1" descriptionPropertiesKey="ALL_SAINTS"/>
<Fixed month="DECEMBER" day="8" descriptionPropertiesKey="IMMACULATE_CONCEPTION"/>
Expand Down

0 comments on commit b701736

Please sign in to comment.