mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
[ephemeris] Add support for overriding holiday definitions (#3573)
* Add support for overriding holiday definitions End Danish General Prayer Day Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
+15
@@ -47,6 +47,7 @@ import org.openhab.core.test.java.JavaOSGiTest;
|
||||
public class EphemerisManagerImplOSGiTest extends JavaOSGiTest {
|
||||
private static final String INTERNAL_DAYSET = "internal";
|
||||
private static final URI CONFIG_URI = URI.create("system:ephemeris");
|
||||
private static final String COUNTRY_DENMARK_KEY = "dk";
|
||||
private static final String COUNTRY_AUSTRALIA_KEY = "au";
|
||||
private static final String COUNTRY_AUSTRALIA_NAME = "Australia";
|
||||
private static final String REGION_BAVARIA_KEY = "by";
|
||||
@@ -263,6 +264,20 @@ public class EphemerisManagerImplOSGiTest extends JavaOSGiTest {
|
||||
assertFalse(vacation);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsBankHolidayWhenGeneralPrayerDay2023() {
|
||||
ZonedDateTime generalPrayerDay = ZonedDateTime.of(2023, 05, 05, 0, 0, 0, 0, ZoneId.of("Europe/Paris"));
|
||||
ephemerisManager.modified(Map.of(CONFIG_COUNTRY, COUNTRY_DENMARK_KEY));
|
||||
assertTrue(ephemerisManager.isBankHoliday(generalPrayerDay));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsBankHolidayWhenGeneralPrayerDay2024() {
|
||||
ZonedDateTime generalPrayerDay = ZonedDateTime.of(2024, 04, 26, 0, 0, 0, 0, ZoneId.of("Europe/Paris"));
|
||||
ephemerisManager.modified(Map.of(CONFIG_COUNTRY, COUNTRY_DENMARK_KEY));
|
||||
assertFalse(ephemerisManager.isBankHoliday(generalPrayerDay));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetBankHoliday() {
|
||||
ZonedDateTime theDay = ZonedDateTime.of(2019, 01, 01, 0, 0, 0, 0, ZoneId.of("Europe/Paris"));
|
||||
|
||||
Reference in New Issue
Block a user