Repository: focus-shift/jollyday (java)

Issue:
Switzerland - Peter und Paul ist Observance
### Affected country

Switzerland

### Affected public holiday

St. Peter and Paul

### Source of the information

https://www.timeanddate.de/feiertage/schweiz/peter-und-paul

### More information

Peter and Paul will be a public holiday until 2020 and since 2021 observance

Pull request:
switzerland: peter and paul observance since 2021
closes #671

<!--

Thanks for contributing.
Please review the following notes before submitting you pull request.

Please look for other issues or pull requests which already work on this topic. Is somebody already on it? Do you need to synchronize?

# Security Vulnerabilities

🛑 STOP! 🛑 If your contribution fixes a security vulnerability, please do not submit it.
Instead, please write an E-Mail to to one of the maintainer with all the information
to recreate the security vulnerability.

# Describing Your Changes

If, having reviewed the notes above, you're ready to submit your pull request, please
provide a brief description of the proposed changes.

If they:
 🐞 fix a bug, please describe the broken behaviour and how the changes fix it.
    Please label with 'type: bug' and 'status: new'
    
 🎁 make an enhancement, please describe the new functionality and why you believe it's useful.
    Please label with 'type: enhancement' and 'status: new'
 
If your pull request relates to any existing issues,
please reference them by using the issue number prefixed with #.

-->


Patch:
diff --git a/jollyday-core/src/main/resources/holidays/Holidays_ch.xml b/jollyday-core/src/main/resources/holidays/Holidays_ch.xml
index facb184e..3bb2d40e 100644
--- a/jollyday-core/src/main/resources/holidays/Holidays_ch.xml
+++ b/jollyday-core/src/main/resources/holidays/Holidays_ch.xml
@@ -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"/>


Test patch:
diff --git a/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidayCHTest.java b/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidayCHTest.java
index 879a9fef..8e27c7f0 100644
--- a/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidayCHTest.java
+++ b/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidayCHTest.java
@@ -12,6 +12,7 @@ import java.time.Year;
 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;
@@ -47,7 +48,7 @@ class HolidayCHTest extends AbstractCountryTestBase {
   }
 
   @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)
@@ -55,6 +56,15 @@ class HolidayCHTest extends AbstractCountryTestBase {
       .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));
diff --git a/jollyday-tests/src/test/resources/holidays/Holidays_test_ch_2022.xml b/jollyday-tests/src/test/resources/holidays/Holidays_test_ch_2022.xml
index 009a07bc..e4519093 100644
--- a/jollyday-tests/src/test/resources/holidays/Holidays_test_ch_2022.xml
+++ b/jollyday-tests/src/test/resources/holidays/Holidays_test_ch_2022.xml
@@ -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"/>