From 42535ab5d2c9e7ba84a4d46834e6b49d508392ca Mon Sep 17 00:00:00 2001 From: Tobias Schneider Date: Wed, 6 Mar 2024 13:28:11 +0100 Subject: [PATCH] Remove all unofficial holidays * Countries: be, mx, at --- README.md | 1 - .../de/focus_shift/jollyday/core/HolidayType.java | 5 +---- .../jollyday/schema/holiday/holiday.xsd | 1 - .../src/main/resources/holidays/Holidays_at.xml | 2 -- .../src/main/resources/holidays/Holidays_be.xml | 3 --- .../src/main/resources/holidays/Holidays_mx.xml | 12 ------------ .../de/focus_shift/jollyday/core/HolidayTest.java | 4 ++-- .../jollyday/jackson/mapping/HolidayType.java | 3 +-- .../jollyday/tests/HolidayManagerTest.java | 14 +++++++------- .../src/test/resources/holidays/Holidays_test.xml | 2 +- 10 files changed, 12 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 76254e2e0..0cbd1b234 100644 --- a/README.md +++ b/README.md @@ -210,7 +210,6 @@ The following holiday types are supported: |------------|---------------------------------------------------------------------------------------------------------| | Public | Public holiday | | Bank | Bank holiday, banks and offices are closed | -| Unofficial | Unofficial holiday that is no
public or bank holiday
(Deprecated, please use the other types) | ## Development diff --git a/jollyday-core/src/main/java/de/focus_shift/jollyday/core/HolidayType.java b/jollyday-core/src/main/java/de/focus_shift/jollyday/core/HolidayType.java index ae7ffb0e5..1d84b11e6 100644 --- a/jollyday-core/src/main/java/de/focus_shift/jollyday/core/HolidayType.java +++ b/jollyday-core/src/main/java/de/focus_shift/jollyday/core/HolidayType.java @@ -8,8 +8,5 @@ public enum HolidayType { PUBLIC_HOLIDAY, - BANK_HOLIDAY, - - @Deprecated(since = "0.26.0", forRemoval = true) - UNOFFICIAL_HOLIDAY; + BANK_HOLIDAY } diff --git a/jollyday-core/src/main/resources/focus_shift.de/jollyday/schema/holiday/holiday.xsd b/jollyday-core/src/main/resources/focus_shift.de/jollyday/schema/holiday/holiday.xsd index 448384139..aee9ede86 100644 --- a/jollyday-core/src/main/resources/focus_shift.de/jollyday/schema/holiday/holiday.xsd +++ b/jollyday-core/src/main/resources/focus_shift.de/jollyday/schema/holiday/holiday.xsd @@ -194,7 +194,6 @@ - diff --git a/jollyday-core/src/main/resources/holidays/Holidays_at.xml b/jollyday-core/src/main/resources/holidays/Holidays_at.xml index 3f020b86b..1e288e4c8 100644 --- a/jollyday-core/src/main/resources/holidays/Holidays_at.xml +++ b/jollyday-core/src/main/resources/holidays/Holidays_at.xml @@ -12,10 +12,8 @@ - - diff --git a/jollyday-core/src/main/resources/holidays/Holidays_be.xml b/jollyday-core/src/main/resources/holidays/Holidays_be.xml index c2d29b3c0..661e90329 100644 --- a/jollyday-core/src/main/resources/holidays/Holidays_be.xml +++ b/jollyday-core/src/main/resources/holidays/Holidays_be.xml @@ -10,11 +10,8 @@ - - - diff --git a/jollyday-core/src/main/resources/holidays/Holidays_mx.xml b/jollyday-core/src/main/resources/holidays/Holidays_mx.xml index 0cf9e9646..fc492878f 100644 --- a/jollyday-core/src/main/resources/holidays/Holidays_mx.xml +++ b/jollyday-core/src/main/resources/holidays/Holidays_mx.xml @@ -5,12 +5,6 @@ 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"> - - - - @@ -35,10 +29,4 @@ - - - - - - diff --git a/jollyday-core/src/test/java/de/focus_shift/jollyday/core/HolidayTest.java b/jollyday-core/src/test/java/de/focus_shift/jollyday/core/HolidayTest.java index 85704c032..4a7bb6387 100644 --- a/jollyday-core/src/test/java/de/focus_shift/jollyday/core/HolidayTest.java +++ b/jollyday-core/src/test/java/de/focus_shift/jollyday/core/HolidayTest.java @@ -5,8 +5,8 @@ import java.time.LocalDate; import java.util.Locale; +import static de.focus_shift.jollyday.core.HolidayType.BANK_HOLIDAY; import static de.focus_shift.jollyday.core.HolidayType.PUBLIC_HOLIDAY; -import static de.focus_shift.jollyday.core.HolidayType.UNOFFICIAL_HOLIDAY; import static java.util.Locale.ENGLISH; import static java.util.Locale.GERMAN; import static org.assertj.core.api.Assertions.assertThat; @@ -64,7 +64,7 @@ void testHolidayEquals() { final Holiday h3 = new Holiday(LocalDate.of(2011, 2, 2), "NEW_YEAR", PUBLIC_HOLIDAY); assertThat(h1).isNotEqualTo(h3); - final Holiday h4 = new Holiday(LocalDate.of(2011, 2, 2), "CHRISTMAS", UNOFFICIAL_HOLIDAY); + final Holiday h4 = new Holiday(LocalDate.of(2011, 2, 2), "CHRISTMAS", BANK_HOLIDAY); assertThat(h1).isNotEqualTo(h4); } } diff --git a/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/mapping/HolidayType.java b/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/mapping/HolidayType.java index e444ad734..2aa48bcd3 100644 --- a/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/mapping/HolidayType.java +++ b/jollyday-jackson/src/main/java/de/focus_shift/jollyday/jackson/mapping/HolidayType.java @@ -3,8 +3,7 @@ public enum HolidayType { PUBLIC_HOLIDAY, - BANK_HOLIDAY, - UNOFFICIAL_HOLIDAY; + BANK_HOLIDAY; public String value() { return name(); diff --git a/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/HolidayManagerTest.java b/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/HolidayManagerTest.java index 37b159671..439542769 100644 --- a/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/HolidayManagerTest.java +++ b/jollyday-tests/src/test/java/de/focus_shift/jollyday/tests/HolidayManagerTest.java @@ -23,8 +23,8 @@ import java.util.stream.Stream; import static de.focus_shift.jollyday.core.HolidayCalendar.GERMANY; +import static de.focus_shift.jollyday.core.HolidayType.BANK_HOLIDAY; import static de.focus_shift.jollyday.core.HolidayType.PUBLIC_HOLIDAY; -import static de.focus_shift.jollyday.core.HolidayType.UNOFFICIAL_HOLIDAY; import static de.focus_shift.jollyday.core.ManagerParameters.create; import static java.time.Month.APRIL; import static java.time.Month.AUGUST; @@ -180,7 +180,7 @@ void ensureIsHolidayMethodReturnsTrueFalseForCalendarChronologyAndHolidayType() calendar.set(YEAR, 2010); calendar.set(MONTH, Calendar.JANUARY); calendar.set(DAY_OF_MONTH, 4); - assertThat(sut.isHoliday(calendar, UNOFFICIAL_HOLIDAY)).isTrue(); + assertThat(sut.isHoliday(calendar, BANK_HOLIDAY)).isTrue(); assertThat(sut.isHoliday(calendar, PUBLIC_HOLIDAY)).isFalse(); } @@ -195,7 +195,7 @@ void ensureIsHolidayMethodReturnsTrueFalseForLocalDate() { void ensureIsHolidayMethodReturnsTrueFalseForLocalDateWithHolidayType() { final HolidayManager sut = HolidayManager.getInstance(create("test")); assertThat(sut.isHoliday(LocalDate.of(2010, 1, 4), PUBLIC_HOLIDAY)).isFalse(); - assertThat(sut.isHoliday(LocalDate.of(2010, 1, 4), UNOFFICIAL_HOLIDAY)).isTrue(); + assertThat(sut.isHoliday(LocalDate.of(2010, 1, 4), BANK_HOLIDAY)).isTrue(); } @Test @@ -247,9 +247,9 @@ void ensureToRetrieveHolidaysFromBaseLevelHierarchy() { @Test void ensureToRetrieveHolidaysByType() { final HolidayManager sut = HolidayManager.getInstance(create("test")); - final Set holidays = sut.getHolidays(2010, UNOFFICIAL_HOLIDAY); + final Set holidays = sut.getHolidays(2010, BANK_HOLIDAY); assertThat(holidays) - .containsOnly(new Holiday(LocalDate.of(2010, 1, 4), "", UNOFFICIAL_HOLIDAY)); + .containsOnly(new Holiday(LocalDate.of(2010, 1, 4), "", BANK_HOLIDAY)); } private static Stream firstLevel() { @@ -295,9 +295,9 @@ void ensureToTestIntervalToRetrieveHolidays() { @Test void ensureToTestIntervalToRetrieveHolidaysByType() { final HolidayManager sut = HolidayManager.getInstance(create("test")); - final Set holidays = sut.getHolidays(LocalDate.of(2010, 1, 1), LocalDate.of(2010, 1, 31), UNOFFICIAL_HOLIDAY); + final Set holidays = sut.getHolidays(LocalDate.of(2010, 1, 1), LocalDate.of(2010, 1, 31), BANK_HOLIDAY); assertThat(holidays) - .containsOnly(new Holiday(LocalDate.of(2010, 1, 4), "", UNOFFICIAL_HOLIDAY)); + .containsOnly(new Holiday(LocalDate.of(2010, 1, 4), "", BANK_HOLIDAY)); } @Test diff --git a/jollyday-tests/src/test/resources/holidays/Holidays_test.xml b/jollyday-tests/src/test/resources/holidays/Holidays_test.xml index 6f90dbb40..4d7dedf02 100644 --- a/jollyday-tests/src/test/resources/holidays/Holidays_test.xml +++ b/jollyday-tests/src/test/resources/holidays/Holidays_test.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://focus_shift.de/jollyday/schema/holiday https://focus_shift.de/jollyday/schema/holiday/holiday.xsd"> - +