Repository: focus-shift/jollyday (java)

Issue:
Slovakia - Constitution Day is not a public holiday
### Affected country

Slovakia

### Affected public holiday

Constitution Day

### Source of the information

https://mzv.sk/en/web/en/slovakia/public-holidays

### More information

Constitution day is from type observance

Pull request:
slovakia: constitution day as observance since 2025
closes #744

<!--

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 4a76eea2..08bbb7da 100644
--- a/jollyday-core/src/main/resources/holidays/Holidays_ch.xml
+++ b/jollyday-core/src/main/resources/holidays/Holidays_ch.xml
@@ -6,7 +6,6 @@
                xsi:schemaLocation="https://focus_shift.de/jollyday/schema/holiday https://focus_shift.de/jollyday/schema/holiday/holiday.xsd">
   <Holidays>
     <Fixed month="JANUARY" day="1" descriptionPropertiesKey="NEW_YEAR"/>
-    <Fixed month="JANUARY" day="2" descriptionPropertiesKey="ST_BERCHTHOLD" localizedType="BANK_HOLIDAY"/>
     <Fixed month="AUGUST" day="1" descriptionPropertiesKey="NATIONAL_DAY"/>
     <Fixed month="DECEMBER" day="25" descriptionPropertiesKey="CHRISTMAS"/>
     <ChristianHoliday type="ASCENSION_DAY" descriptionPropertiesKey="christian.ASCENSION_DAY"/>
@@ -16,7 +15,6 @@
   <Sources>
     <Source of="ISO 3166">https://www.iso.org/obp/ui/#iso:code:3166:CH</Source>
     <Source of="ISO 3166-2">https://en.wikipedia.org/wiki/ISO_3166-2:CH</Source>
-    <Source of="ST Berchthold as bank holiday">https://www.six-group.com/de/market-data/news-tools/trading-currency-holiday-calendar.html</Source>
   </Sources>
 
   <SubConfigurations hierarchy="ag" description="Aargau">
diff --git a/jollyday-core/src/main/resources/holidays/Holidays_sk.xml b/jollyday-core/src/main/resources/holidays/Holidays_sk.xml
index bdb85c14..4dcd2c2e 100644
--- a/jollyday-core/src/main/resources/holidays/Holidays_sk.xml
+++ b/jollyday-core/src/main/resources/holidays/Holidays_sk.xml
@@ -11,7 +11,8 @@
     <Fixed month="MAY" day="8" descriptionPropertiesKey="VICTORY"/>
     <Fixed month="JULY" day="5" descriptionPropertiesKey="CYRUS_METHODIUS"/>
     <Fixed month="AUGUST" day="29" descriptionPropertiesKey="NATIONAL_UPRISING"/>
-    <Fixed month="SEPTEMBER" day="1" descriptionPropertiesKey="CONSTITUTION_DAY" localizedType="OBSERVANCE"/>
+    <Fixed month="SEPTEMBER" day="1" validTo="2024" descriptionPropertiesKey="CONSTITUTION_DAY"/>
+    <Fixed month="SEPTEMBER" day="1" validFrom="2025" descriptionPropertiesKey="CONSTITUTION_DAY" localizedType="OBSERVANCE"/>
     <Fixed month="SEPTEMBER" day="15" descriptionPropertiesKey="VIRGIN_MARY"/>
     <Fixed month="NOVEMBER" day="1" descriptionPropertiesKey="ALL_SAINTS"/>
     <Fixed month="NOVEMBER" day="17" descriptionPropertiesKey="FREEDOM_DEMOCRACY"/>


Test patch:
diff --git a/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/CalendarChecker.java b/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/CalendarChecker.java
index 4e977acd..637b7d8e 100644
--- a/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/CalendarChecker.java
+++ b/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/CalendarChecker.java
@@ -14,7 +14,6 @@ import java.time.Month;
 import java.time.Year;
 import java.time.temporal.TemporalAdjusters;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Objects;
 import java.util.Set;
@@ -189,7 +188,6 @@ public class CalendarChecker implements CalendarCheckerApi.Holiday, CalendarChec
 
             assertThat(holidays)
               .isNotEmpty()
-              .as(() -> "Failure in a holiday for " + holidayManager.getManagerParameter().getDisplayName() + " " + Arrays.toString(check.getSubdivisions()))
               .doesNotContain(new Holiday(date, check.getPropertiesKey(), check.getHolidayType()));
           }
         );
@@ -206,7 +204,6 @@ public class CalendarChecker implements CalendarCheckerApi.Holiday, CalendarChec
 
             assertThat(holidays)
               .isNotEmpty()
-              .as(() -> "Failure in a holiday for " + holidayManager.getManagerParameter().getDisplayName() + " " + Arrays.toString(check.getSubdivisions()))
               .contains(new Holiday(date, check.getPropertiesKey(), check.getHolidayType()));
           }
         );
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 147b4877..49bdb722 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
@@ -2,15 +2,13 @@ package de.focus_shift.jollyday.tests.country;
 
 import org.junit.jupiter.api.Test;
 
+
 import static de.focus_shift.jollyday.core.HolidayCalendar.SWITZERLAND;
-import static de.focus_shift.jollyday.core.HolidayType.BANK_HOLIDAY;
-import static de.focus_shift.jollyday.core.HolidayType.OBSERVANCE;
 import static de.focus_shift.jollyday.tests.CalendarCheckerApi.assertFor;
 import static java.time.Month.AUGUST;
 import static java.time.Month.DECEMBER;
 import static java.time.Month.JANUARY;
 import static java.time.Month.MARCH;
-import static java.time.Month.MAY;
 import static java.time.Month.NOVEMBER;
 
 
@@ -20,7 +18,6 @@ class HolidayCHTest {
   void ensuresHolidays() {
     assertFor(SWITZERLAND)
       .hasFixedHoliday("NEW_YEAR", JANUARY, 1).and()
-      .hasFixedHoliday("ST_BERCHTHOLD", JANUARY, 2, BANK_HOLIDAY).and()
       .hasFixedHoliday("NATIONAL_DAY", AUGUST, 1).and()
       .hasFixedHoliday("CHRISTMAS", DECEMBER, 25).and()
       .hasChristianHoliday("ASCENSION_DAY").and()
@@ -48,72 +45,7 @@ class HolidayCHTest {
       .hasFixedHoliday("ASSUMPTION_DAY", AUGUST, 15).inSubdivision("vs").and()
       .hasFixedHoliday("ALL_SAINTS", NOVEMBER, 1).inSubdivision("vs").and()
       .hasFixedHoliday("IMMACULATE_CONCEPTION", DECEMBER, 8).inSubdivision("vs").and()
-      .hasChristianHoliday("CORPUS_CHRISTI").inSubdivision("vs").and()
-
-
-      /*Aargau*/
-      /*Innerrhoden*/
-      /*Ausserrhoden*/
-
-      /*Bern*/
-      .hasFixedHoliday("ST_BERCHTHOLD", JANUARY, 2).inSubdivision("be").and()
-      .hasFixedHoliday("STEPHENS", DECEMBER, 26).inSubdivision("be").and()
-      .hasChristianHoliday("GOOD_FRIDAY").inSubdivision("be").and()
-      .hasChristianHoliday("WHIT_MONDAY").inSubdivision("be").and()
-
-      /*Basel-Landschaft*/
-      /*Basel-Stadt*/
-
-      /*Freiburg*/
-      .hasFixedHoliday("ST_BERCHTHOLD", JANUARY, 2).inSubdivision("fr").and()
-      .hasFixedHoliday("ASSUMPTION_DAY", AUGUST, 15).inSubdivision("fr").and()
-      .hasFixedHoliday("ALL_SAINTS", NOVEMBER, 1).inSubdivision("fr").and()
-      .hasFixedHoliday("IMMACULATE_CONCEPTION", DECEMBER, 8).inSubdivision("fr").and()
-      .hasFixedHoliday("STEPHENS", DECEMBER, 26).inSubdivision("fr").and()
-      .hasChristianHoliday("GOOD_FRIDAY").inSubdivision("fr").and()
-      .hasChristianHoliday("EASTER_MONDAY").inSubdivision("fr").and()
-      .hasChristianHoliday("WHIT_MONDAY").inSubdivision("fr").and()
-      .hasChristianHoliday("CORPUS_CHRISTI").inSubdivision("fr").and()
-
-      /*Genève*/
-      /*Glarus*/
-      /*Graubünden*/
-      /*Jura*/
-      /*Luzern*/
-      /*Neuchâtel*/
-      /*Nidwalden*/
-      /*Obwalden*/
-      /*Gallen*/
-
-      /*Schaffhausen*/
-      .hasFixedHoliday("ST_BERCHTHOLD", JANUARY, 2).inSubdivision("sh").and()
-      .hasFixedHoliday("LABOUR_DAY", MAY, 1).inSubdivision("sh").and()
-      .hasFixedHoliday("STEPHENS", DECEMBER, 26).inSubdivision("sh").and()
-      .hasChristianHoliday("GOOD_FRIDAY").inSubdivision("sh").and()
-      .hasChristianHoliday("WHIT_MONDAY").inSubdivision("sh").and()
-
-      /*Solothurn*/
-      /*Schwyz*/
-
-      /*Thurgau*/
-      .hasFixedHoliday("ST_BERCHTHOLD", JANUARY, 2).inSubdivision("tg").and()
-      .hasFixedHoliday("LABOUR_DAY", MAY, 1, OBSERVANCE).inSubdivision("tg").and()
-      .hasFixedHoliday("STEPHENS", DECEMBER, 26).inSubdivision("tg").and()
-      .hasChristianHoliday("GOOD_FRIDAY").inSubdivision("tg").and()
-      .hasChristianHoliday("WHIT_MONDAY").inSubdivision("tg").and()
-
-      /*Ticino*/
-      /*Uri*/
-
-      /*Vaud*/
-      .hasFixedHoliday("ST_BERCHTHOLD", JANUARY, 2).inSubdivision("vd").and()
-      .hasChristianHoliday("GOOD_FRIDAY").inSubdivision("vd").and()
-      .hasChristianHoliday("EASTER_MONDAY").inSubdivision("vd").and()
-      .hasChristianHoliday("WHIT_MONDAY").inSubdivision("vd")
-
-      /*Valais*/
-      /*Zug*/
-      /*Zürich*/
+      .hasChristianHoliday("CORPUS_CHRISTI").inSubdivision("vs")
 
       .check();
   }
diff --git a/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidaySKTest.java b/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidaySKTest.java
index 675fbfa8..d6b1101c 100644
--- a/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidaySKTest.java
+++ b/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidaySKTest.java
@@ -32,7 +32,14 @@ class HolidaySKTest {
       .hasFixedHoliday("VICTORY", MAY, 8).and()
       .hasFixedHoliday("CYRUS_METHODIUS", JULY, 5).and()
       .hasFixedHoliday("NATIONAL_UPRISING", AUGUST, 29).and()
-      .hasFixedHoliday("CONSTITUTION_DAY", SEPTEMBER, 1, OBSERVANCE).and()
+      .hasFixedHoliday("CONSTITUTION_DAY", SEPTEMBER, 1)
+        .between(Year.of(1900), Year.of(2024))
+        .notBetween(Year.of(2025), Year.of(2500))
+      .and()
+      .hasFixedHoliday("CONSTITUTION_DAY", SEPTEMBER, 1, OBSERVANCE)
+        .notBetween(Year.of(1900), Year.of(2024))
+        .between(Year.of(2025), Year.of(2500))
+      .and()
       .hasFixedHoliday("VIRGIN_MARY", SEPTEMBER, 15).and()
       .hasFixedHoliday("ALL_SAINTS", NOVEMBER, 1).and()
       .hasFixedHoliday("FREEDOM_DEMOCRACY", NOVEMBER, 17).and()