Repository: focus-shift/jollyday
Pull request #443 (2024-02-01 00:44:45)

Add Juneteenth to nyse calendar. Fixes gh-442
Fixes Issue #442 


Patch:
diff --git a/jollyday-core/src/main/resources/holidays/Holidays_nyse.xml b/jollyday-core/src/main/resources/holidays/Holidays_nyse.xml
index c7caaeba..244265a8 100644
--- a/jollyday-core/src/main/resources/holidays/Holidays_nyse.xml
+++ b/jollyday-core/src/main/resources/holidays/Holidays_nyse.xml
@@ -9,6 +9,10 @@
       <MovingCondition substitute="SATURDAY" with="PREVIOUS" weekday="FRIDAY"/>
       <MovingCondition substitute="SUNDAY" with="NEXT" weekday="MONDAY"/>
     </Fixed>
+    <Fixed month="JUNE" day="19" validFrom="2022" descriptionPropertiesKey="JUNETEENTH">
+      <MovingCondition substitute="SATURDAY" with="PREVIOUS" weekday="FRIDAY"/>
+      <MovingCondition substitute="SUNDAY" with="NEXT" weekday="MONDAY"/>
+    </Fixed>
     <Fixed month="JULY" day="4" descriptionPropertiesKey="INDEPENDENCE_DAY">
       <MovingCondition substitute="SATURDAY" with="PREVIOUS" weekday="FRIDAY"/>
       <MovingCondition substitute="SUNDAY" with="NEXT" weekday="MONDAY"/>


Test patch:
diff --git a/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidayNYSETest.java b/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidayNYSETest.java
new file mode 100644
index 00000000..cd3b9960
--- /dev/null
+++ b/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/country/HolidayNYSETest.java
@@ -0,0 +1,15 @@
+package de.focus_shift.jollyday.tests.country;
+
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class HolidayNYSETest extends AbstractCountryTestBase {
+
+  private static final String ISO_CODE = "nyse";
+
+  @ParameterizedTest
+  @ValueSource(ints = {2023})
+  void testManagerNYSEStructure(final int year) {
+    validateCalendarData(ISO_CODE, year, true);
+  }
+}
diff --git a/jollyday-tests/src/test/resources/holidays/Holidays_test_nyse_2023.xml b/jollyday-tests/src/test/resources/holidays/Holidays_test_nyse_2023.xml
new file mode 100644
index 00000000..592d85a0
--- /dev/null
+++ b/jollyday-tests/src/test/resources/holidays/Holidays_test_nyse_2023.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration hierarchy="nyse" description="New York Stock Exchange"
+               xmlns="https://focus_shift.de/jollyday/schema/holiday"
+               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xsi:schemaLocation="https://focus_shift.de/jollyday/schema/holiday https://focus_shift.de/jollyday/schema/holiday/holiday.xsd">
+  <Holidays>
+    <Fixed month="JANUARY" day="2" descriptionPropertiesKey="NEW_YEAR"/>
+    <Fixed month="JANUARY" day="16" descriptionPropertiesKey="MARTIN_LUTHER_KING"/>
+    <Fixed month="FEBRUARY" day="20" descriptionPropertiesKey="WASHINGTONS_BIRTHDAY"/>
+    <Fixed month="APRIL" day="7" descriptionPropertiesKey="christian.GOOD_FRIDAY"/>
+    <Fixed month="MAY" day="29" descriptionPropertiesKey="MEMORIAL_DAY"/>
+    <Fixed month="JUNE" day="19" descriptionPropertiesKey="JUNETEENTH"/>
+    <Fixed month="JULY" day="4" descriptionPropertiesKey="INDEPENDENCE_DAY"/>
+    <Fixed month="SEPTEMBER" day="4" descriptionPropertiesKey="LABOUR_DAY"/>
+    <Fixed month="NOVEMBER" day="23" descriptionPropertiesKey="THANKSGIVING"/>
+    <Fixed month="DECEMBER" day="25" descriptionPropertiesKey="CHRISTMAS"/>
+  </Holidays>
+</Configuration>