Repository: urlaubsverwaltung/urlaubsverwaltung
Pull request #4751 (2024-06-24 12:18:09)

Remove deprecated getPublicHolidays methods
<!--

Thanks for contributing to the Urlaubsverwaltung.
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 open a report of a security vulnerability via
[Report a security vulnerability](https://github.com/urlaubsverwaltung/urlaubsverwaltung/security/advisories/new)


# 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 #.

-->


sonarcloud[bot]: ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=urlaubsverwaltung_urlaubsverwaltung&pullRequest=4751) **Quality Gate failed**  
Failed conditions  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=urlaubsverwaltung_urlaubsverwaltung&pullRequest=4751) (required ≥ A)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=urlaubsverwaltung_urlaubsverwaltung&pullRequest=4751)

##   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)



Patch:
diff --git a/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayApiController.java b/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayApiController.java
index e19c9dd23..8d4297fd5 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayApiController.java
+++ b/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayApiController.java
@@ -82,7 +82,7 @@ public class PublicHolidayApiController {
         final WorkingTimeSettings workingTimeSettings = settingsService.getSettings().getWorkingTimeSettings();
         final FederalState federalState = workingTimeSettings.getFederalState();
 
-        final List<PublicHolidayDto> publicHolidays = getPublicHolidays(startDate, endDate, federalState, workingTimeSettings);
+        final List<PublicHolidayDto> publicHolidays = getPublicHolidays(startDate, endDate, federalState);
         return new PublicHolidaysDto(publicHolidays);
     }
 
@@ -129,11 +129,9 @@ public class PublicHolidayApiController {
         final Person person = optionalPerson.get();
         final DateRange dateRange = new DateRange(startDate, endDate);
 
-        final WorkingTimeSettings workingTimeSettings = settingsService.getSettings().getWorkingTimeSettings();
-
         final List<PublicHolidayDto> publicHolidays = workingTimeService.getFederalStatesByPersonAndDateRange(person, dateRange)
             .entrySet().stream()
-            .map(entry -> getPublicHolidays(entry.getKey().startDate(), entry.getKey().endDate(), entry.getValue(), workingTimeSettings))
+            .map(entry -> getPublicHolidays(entry.getKey().startDate(), entry.getKey().endDate(), entry.getValue()))
             .flatMap(List::stream)
             .sorted(Comparator.comparing(PublicHolidayDto::getDate))
             .toList();
@@ -141,8 +139,8 @@ public class PublicHolidayApiController {
         return new PublicHolidaysDto(publicHolidays);
     }
 
-    private List<PublicHolidayDto> getPublicHolidays(LocalDate startDate, LocalDate endDate, FederalState federalState, WorkingTimeSettings workingTimeSettings) {
-        return publicHolidaysService.getPublicHolidays(startDate, endDate, federalState, workingTimeSettings).stream()
+    private List<PublicHolidayDto> getPublicHolidays(LocalDate startDate, LocalDate endDate, FederalState federalState) {
+        return publicHolidaysService.getPublicHolidays(startDate, endDate, federalState).stream()
             .map(this::mapPublicHolidayToDto)
             .toList();
     }
diff --git a/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysService.java b/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysService.java
index 0cbf9c599..f2d531061 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysService.java
+++ b/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysService.java
@@ -1,7 +1,6 @@
 package org.synyx.urlaubsverwaltung.publicholiday;
 
 import org.synyx.urlaubsverwaltung.workingtime.FederalState;
-import org.synyx.urlaubsverwaltung.workingtime.WorkingTimeSettings;
 
 import java.time.LocalDate;
 import java.util.List;
@@ -43,40 +42,4 @@ public interface PublicHolidaysService {
      * @return a list of public holiday if there are any for the given date range, otherwise empty list
      */
     List<PublicHoliday> getPublicHolidays(LocalDate from, LocalDate to, FederalState federalState);
-
-    /**
-     * Returns an optional of public holiday information for the given date and the federal state.
-     * If there is no public holiday at the given date range the return value is an empty optional, otherwise
-     * the public holiday will be returned in an optional.
-     * <p>
-     * Hint: we added this method so that the working time settings will not be requested from the database for each call of a day e.g.
-     * We will remove this method when the "betriebsferien" will be ready so that we do not need to call for Christmas and new years eve.
-     *
-     * @param date                to get public holiday from
-     * @param federalState        the federal state to consider holiday settings for
-     * @param workingTimeSettings needs the working time settings for Christmas and new years eve
-     * @return a optional of public holiday if there are any for the given date, otherwise empty optional
-     */
-    @Deprecated(since = "4.48.0", forRemoval = true)
-    Optional<PublicHoliday> getPublicHoliday(LocalDate date, FederalState federalState, WorkingTimeSettings workingTimeSettings);
-
-    /**
-     * Returns a list of public holiday information for the given date range (inclusive from and to) and the federal state.
-     * If there is no public holiday at the given date range the return value is an empty list, otherwise
-     * the public holidays will be returned.
-     * <p>
-     * Hint: we added this method so that the working time settings will not be requested from the database for each call of a day e.g.
-     * We will remove this method when the "betriebsferien" will be ready so that we do not need to call for Christmas and new years eve.
-     * <p>
-     * Hint: it is possible that there are two public holidays at the same day e.g. if there is a fixed public holiday
-     * and a movable that will be at the same day in a special year.
-     *
-     * @param from                to get public holiday from
-     * @param to                  to get public holiday to
-     * @param federalState        the federal state to consider holiday settings for
-     * @param workingTimeSettings needs the working time settings for Christmas and new years eve
-     * @return a list of public holiday if there are any for the given date range, otherwise empty list
-     */
-    @Deprecated(since = "4.48.0", forRemoval = true)
-    List<PublicHoliday> getPublicHolidays(LocalDate from, LocalDate to, FederalState federalState, WorkingTimeSettings workingTimeSettings);
 }
diff --git a/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysServiceImpl.java b/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysServiceImpl.java
index 1d7192669..bd2dd2f57 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysServiceImpl.java
+++ b/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysServiceImpl.java
@@ -49,16 +49,6 @@ public class PublicHolidaysServiceImpl implements PublicHolidaysService {
     @Override
     public List<PublicHoliday> getPublicHolidays(LocalDate from, LocalDate to, FederalState federalState) {
         final WorkingTimeSettings workingTimeSettings = getWorkingTimeSettings();
-        return getPublicHolidays(from, to, federalState, workingTimeSettings);
-    }
-
-    @Override
-    public Optional<PublicHoliday> getPublicHoliday(LocalDate date, FederalState federalState, WorkingTimeSettings workingTimeSettings) {
-        return getPublicHolidays(date, date, federalState, workingTimeSettings).stream().findFirst();
-    }
-
-    @Override
-    public List<PublicHoliday> getPublicHolidays(LocalDate from, LocalDate to, FederalState federalState, WorkingTimeSettings workingTimeSettings) {
         final Locale locale = LocaleContextHolder.getLocale();
 
         return getHolidays(from, to, federalState).stream()
diff --git a/src/main/java/org/synyx/urlaubsverwaltung/workingtime/WorkingTimeCalendarServiceImpl.java b/src/main/java/org/synyx/urlaubsverwaltung/workingtime/WorkingTimeCalendarServiceImpl.java
index d17b87ee1..c87185641 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/workingtime/WorkingTimeCalendarServiceImpl.java
+++ b/src/main/java/org/synyx/urlaubsverwaltung/workingtime/WorkingTimeCalendarServiceImpl.java
@@ -24,6 +24,10 @@ import java.util.function.Supplier;
 import static java.time.temporal.TemporalAdjusters.lastDayOfYear;
 import static java.util.stream.Collectors.groupingBy;
 import static java.util.stream.Collectors.toMap;
+import static org.synyx.urlaubsverwaltung.period.DayLength.MORNING;
+import static org.synyx.urlaubsverwaltung.period.DayLength.ZERO;
+import static org.synyx.urlaubsverwaltung.workingtime.WorkingTimeCalendar.WorkingDayInformation.WorkingTimeCalendarEntryType.PUBLIC_HOLIDAY;
+import static org.synyx.urlaubsverwaltung.workingtime.WorkingTimeCalendar.WorkingDayInformation.WorkingTimeCalendarEntryType.WORKDAY;
 
 @Service
 class WorkingTimeCalendarServiceImpl implements WorkingTimeCalendarService {
@@ -47,8 +51,6 @@ class WorkingTimeCalendarServiceImpl implements WorkingTimeCalendarService {
     public Map<Person, WorkingTimeCalendar> getWorkingTimesByPersons(Collection<Person> persons, DateRange dateRange) {
         final CachedSupplier<FederalState> federalStateCachedSupplier = new CachedSupplier<>(this::getSystemDefaultFederalState);
 
-        final WorkingTimeSettings workingTimeSettings = settingsService.getSettings().getWorkingTimeSettings();
-
         final Map<Person, List<WorkingTime>> workingTimesByPerson = workingTimeRepository.findByPersonIsInOrderByValidFromDesc(persons)
             .stream()
             .map(entity -> toWorkingTime(entity, federalStateCachedSupplier))
@@ -77,7 +79,7 @@ class WorkingTimeCalendarServiceImpl implements WorkingTimeCalendarService {
                 }
 
                 for (LocalDate date : workingTimeDateRange) {
-                    dayLengthByDate.put(date, getWorkDayLengthForWeekDay(date, workingTime, workingTimeSettings));
+                    dayLengthByDate.put(date, getWorkDayLengthForWeekDay(date, workingTime));
                 }
 
                 if (workingTimeDateRange.startDate().equals(start)) {
@@ -91,19 +93,19 @@ class WorkingTimeCalendarServiceImpl implements WorkingTimeCalendarService {
         }).collect(toMap(Map.Entry::getKey, Map.Entry::getValue));
     }
 
-    private WorkingDayInformation getWorkDayLengthForWeekDay(LocalDate date, WorkingTime workingTime, WorkingTimeSettings workingTimeSettings) {
+    private WorkingDayInformation getWorkDayLengthForWeekDay(LocalDate date, WorkingTime workingTime) {
         final FederalState federalState = workingTime.getFederalState();
 
         final DayLength configuredWorkingTimeForDayOfWeek = workingTime.getDayLengthForWeekDay(date.getDayOfWeek());
 
-        DayLength morning = configuredWorkingTimeForDayOfWeek.isFull() || configuredWorkingTimeForDayOfWeek.isMorning() ? DayLength.MORNING : DayLength.ZERO;
-        WorkingTimeCalendarEntryType morningType = morning.isMorning() ? WorkingTimeCalendarEntryType.WORKDAY : WorkingTimeCalendarEntryType.NO_WORKDAY;
+        DayLength morning = configuredWorkingTimeForDayOfWeek.isFull() || configuredWorkingTimeForDayOfWeek.isMorning() ? MORNING : ZERO;
+        WorkingTimeCalendarEntryType morningType = morning.isMorning() ? WORKDAY : WorkingTimeCalendarEntryType.NO_WORKDAY;
 
-        DayLength noon = configuredWorkingTimeForDayOfWeek.isFull() || configuredWorkingTimeForDayOfWeek.isNoon() ? DayLength.NOON : DayLength.ZERO;
-        WorkingTimeCalendarEntryType noonType = noon.isNoon() ? WorkingTimeCalendarEntryType.WORKDAY : WorkingTimeCalendarEntryType.NO_WORKDAY;
+        DayLength noon = configuredWorkingTimeForDayOfWeek.isFull() || configuredWorkingTimeForDayOfWeek.isNoon() ? DayLength.NOON : ZERO;
+        WorkingTimeCalendarEntryType noonType = noon.isNoon() ? WORKDAY : WorkingTimeCalendarEntryType.NO_WORKDAY;
 
         if (configuredWorkingTimeForDayOfWeek.getDuration().signum() > 0) {
-            final Optional<PublicHoliday> maybePublicHoliday = publicHolidaysService.getPublicHoliday(date, federalState, workingTimeSettings);
+            final Optional<PublicHoliday> maybePublicHoliday = publicHolidaysService.getPublicHoliday(date, federalState);
 
             if (maybePublicHoliday.isPresent()) {
 
@@ -111,50 +113,50 @@ class WorkingTimeCalendarServiceImpl implements WorkingTimeCalendarService {
 
                 if (configuredWorkingTimeForDayOfWeek.isFull()) {
                     if (publicHoliday.dayLength().isFull()) {
-                        morning = DayLength.ZERO;
-                        morningType = WorkingTimeCalendarEntryType.PUBLIC_HOLIDAY;
-                        noon = DayLength.ZERO;
-                        noonType = WorkingTimeCalendarEntryType.PUBLIC_HOLIDAY;
+                        morning = ZERO;
+                        morningType = PUBLIC_HOLIDAY;
+                        noon = ZERO;
+                        noonType = PUBLIC_HOLIDAY;
                     } else if (publicHoliday.dayLength().isMorning()) {
-                        morning = DayLength.ZERO;
-                        morningType = WorkingTimeCalendarEntryType.PUBLIC_HOLIDAY;
+                        morning = ZERO;
+                        morningType = PUBLIC_HOLIDAY;
                         noon = DayLength.NOON;
-                        noonType = WorkingTimeCalendarEntryType.WORKDAY;
+                        noonType = WORKDAY;
                     } else if (publicHoliday.dayLength().isNoon()) {
-                        morning = DayLength.MORNING;
-                        morningType = WorkingTimeCalendarEntryType.WORKDAY;
-                        noon = DayLength.ZERO;
-                        noonType = WorkingTimeCalendarEntryType.PUBLIC_HOLIDAY;
+                        morning = MORNING;
+                        morningType = WORKDAY;
+                        noon = ZERO;
+                        noonType = PUBLIC_HOLIDAY;
                     } else {
-                        morning = DayLength.MORNING;
-                        morningType = WorkingTimeCalendarEntryType.WORKDAY;
+                        morning = MORNING;
+                        morningType = WORKDAY;
                         noon = DayLength.NOON;
-                        noonType = WorkingTimeCalendarEntryType.WORKDAY;
+                        noonType = WORKDAY;
                     }
                 } else {
                     if (configuredWorkingTimeForDayOfWeek.isMorning()) {
 
-                        noon = DayLength.ZERO;
+                        noon = ZERO;
                         noonType = WorkingTimeCalendarEntryType.NO_WORKDAY;
 
                         if (publicHoliday.isFull() || publicHoliday.isMorning()) {
-                            morning = DayLength.ZERO;
-                            morningType = WorkingTimeCalendarEntryType.PUBLIC_HOLIDAY;
+                            morning = ZERO;
+                            morningType = PUBLIC_HOLIDAY;
                         } else {
-                            morning = DayLength.MORNING;
-                            morningType = WorkingTimeCalendarEntryType.WORKDAY;
+                            morning = MORNING;
+                            morningType = WORKDAY;
                         }
                     } else {
 
-                        morning = DayLength.ZERO;
+                        morning = ZERO;
                         morningType = WorkingTimeCalendarEntryType.NO_WORKDAY;
 
                         if (publicHoliday.isFull() || publicHoliday.isNoon()) {
-                            noon = DayLength.ZERO;
-                            noonType = WorkingTimeCalendarEntryType.PUBLIC_HOLIDAY;
+                            noon = ZERO;
+                            noonType = PUBLIC_HOLIDAY;
                         } else {
                             noon = DayLength.NOON;
-                            noonType = WorkingTimeCalendarEntryType.WORKDAY;
+                            noonType = WORKDAY;
                         }
                     }
                 }
@@ -164,12 +166,12 @@ class WorkingTimeCalendarServiceImpl implements WorkingTimeCalendarService {
         DayLength calculatedDayLength = configuredWorkingTimeForDayOfWeek;
         if (morning.isMorning() && noon.isNoon()) {
             calculatedDayLength = DayLength.FULL;
-        } else if (morning == DayLength.ZERO && noon == DayLength.ZERO) {
-            calculatedDayLength = DayLength.ZERO;
-        } else if (morning == DayLength.ZERO && noon.isNoon()) {
+        } else if (morning == ZERO && noon == ZERO) {
+            calculatedDayLength = ZERO;
+        } else if (morning == ZERO && noon.isNoon()) {
             calculatedDayLength = DayLength.NOON;
-        } else if (morning.isMorning() && noon == DayLength.ZERO) {
-            calculatedDayLength = DayLength.MORNING;
+        } else if (morning.isMorning() && noon == ZERO) {
+            calculatedDayLength = MORNING;
         }
 
         return new WorkingDayInformation(calculatedDayLength, morningType, noonType);


Test patch:
diff --git a/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayApiControllerTest.java b/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayApiControllerTest.java
index da7940f09..e8c978e69 100644
--- a/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayApiControllerTest.java
+++ b/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayApiControllerTest.java
@@ -66,7 +66,7 @@ class PublicHolidayApiControllerTest {
         final LocalDate to = LocalDate.of(2016, 5, 20);
         final PublicHoliday fromHoliday = new PublicHoliday(from, MORNING, "");
         final PublicHoliday toHoliday = new PublicHoliday(to, NOON, "");
-        when(publicHolidaysService.getPublicHolidays(from, to, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings)).thenReturn(List.of(fromHoliday, toHoliday));
+        when(publicHolidaysService.getPublicHolidays(from, to, GERMANY_BADEN_WUERTTEMBERG)).thenReturn(List.of(fromHoliday, toHoliday));
 
         perform(get("/api/public-holidays")
             .param("from", "2016-05-19")
@@ -129,9 +129,6 @@ class PublicHolidayApiControllerTest {
 
         when(personService.getPersonByID(1L)).thenReturn(Optional.of(person));
 
-        final WorkingTimeSettings workingTimeSettings = anyWorkingTimeSettings();
-        when(settingsService.getSettings()).thenReturn(settingsWithWorkingTimeSettings(workingTimeSettings));
-
         final LocalDate from = LocalDate.of(2016, 5, 19);
         final LocalDate to = LocalDate.of(2016, 5, 20);
 
@@ -140,8 +137,8 @@ class PublicHolidayApiControllerTest {
                 new DateRange(from, from), GERMANY_BADEN_WUERTTEMBERG,
                 new DateRange(to, to), GERMANY_BADEN_WUERTTEMBERG
             ));
-        when(publicHolidaysService.getPublicHolidays(from, from, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings)).thenReturn(List.of(new PublicHoliday(from, MORNING, "")));
-        when(publicHolidaysService.getPublicHolidays(to, to, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings)).thenReturn(List.of(new PublicHoliday(to, NOON, "")));
+        when(publicHolidaysService.getPublicHolidays(from, from, GERMANY_BADEN_WUERTTEMBERG)).thenReturn(List.of(new PublicHoliday(from, MORNING, "")));
+        when(publicHolidaysService.getPublicHolidays(to, to, GERMANY_BADEN_WUERTTEMBERG)).thenReturn(List.of(new PublicHoliday(to, NOON, "")));
 
         perform(get("/api/persons/1/public-holidays")
             .param("from", "2016-05-19")
diff --git a/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysServiceImplTest.java b/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysServiceImplTest.java
index 5b8cbd227..622ab4923 100644
--- a/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysServiceImplTest.java
+++ b/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidaysServiceImplTest.java
@@ -5,12 +5,13 @@ import de.focus_shift.jollyday.core.ManagerParameters;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
 import org.synyx.urlaubsverwaltung.period.DayLength;
 import org.synyx.urlaubsverwaltung.settings.Settings;
 import org.synyx.urlaubsverwaltung.settings.SettingsService;
-import org.synyx.urlaubsverwaltung.workingtime.WorkingTimeSettings;
 
 import java.math.BigDecimal;
 import java.net.URL;
@@ -64,19 +65,21 @@ class PublicHolidaysServiceImplTest {
         assertThat(maybePublicHoliday).hasValueSatisfying(publicHoliday -> assertThat(publicHoliday.getWorkingDuration()).isEqualByComparingTo(ZERO));
     }
 
-    @Test
-    void ensureWorkingDurationForChristmasEveCanBeConfiguredToAWorkingDurationOfFullDay() {
+    @ParameterizedTest
+    @CsvSource({"FULL, 1", "MORNING, 0.5", "NOON, 0.5", "ZERO, 0"})
+    void ensureWorkingDurationForChristmasEveCanBeConfiguredToAWorkingDurationOf(String dayLength, double workingDuration) {
 
         final Settings settings = new Settings();
-        settings.getWorkingTimeSettings().setWorkingDurationForChristmasEve(DayLength.FULL);
+        settings.getWorkingTimeSettings().setWorkingDurationForChristmasEve(DayLength.valueOf(dayLength));
         when(settingsService.getSettings()).thenReturn(settings);
 
         final Optional<PublicHoliday> maybePublicHoliday = sut.getPublicHoliday(of(2013, DECEMBER, 24), GERMANY_BADEN_WUERTTEMBERG);
-        assertThat(maybePublicHoliday).hasValueSatisfying(publicHoliday -> assertThat(publicHoliday.getWorkingDuration()).isEqualByComparingTo(ONE));
+        assertThat(maybePublicHoliday).hasValueSatisfying(publicHoliday -> assertThat(publicHoliday.getWorkingDuration()).isEqualByComparingTo(BigDecimal.valueOf(workingDuration)));
     }
 
-    @Test
-    void ensureWorkingDurationForNewYearsEveCanBeConfiguredToAWorkingDurationOfFullDay() {
+    @ParameterizedTest
+    @CsvSource({"FULL, 1", "MORNING, 0.5", "NOON, 0.5", "ZERO, 0"})
+    void ensureWorkingDurationForNewYearsEveCanBeConfiguredToAWorkingDurationOf(String dayLength, double workingDuration) {
 
         final Settings settings = new Settings();
         settings.getWorkingTimeSettings().setWorkingDurationForNewYearsEve(DayLength.FULL);
@@ -86,49 +89,6 @@ class PublicHolidaysServiceImplTest {
         assertThat(maybePublicHoliday).hasValueSatisfying(publicHoliday -> assertThat(publicHoliday.getWorkingDuration()).isEqualByComparingTo(ONE));
     }
 
-    @Test
-    void ensureWorkingDurationForChristmasEveCanBeConfiguredToAWorkingDurationOfMorning() {
-
-        final Settings settings = new Settings();
-        settings.getWorkingTimeSettings().setWorkingDurationForChristmasEve(DayLength.MORNING);
-        when(settingsService.getSettings()).thenReturn(settings);
-
-        final Optional<PublicHoliday> maybePublicHoliday = sut.getPublicHoliday(of(2013, DECEMBER, 24), GERMANY_BADEN_WUERTTEMBERG);
-        assertThat(maybePublicHoliday).hasValueSatisfying(publicHoliday -> assertThat(publicHoliday.getWorkingDuration()).isEqualByComparingTo(BigDecimal.valueOf(0.5)));
-    }
-
-    @Test
-    void ensureWorkingDurationForNewYearsEveCanBeConfiguredToAWorkingDurationOfNoon() {
-
-        final Settings settings = new Settings();
-        settings.getWorkingTimeSettings().setWorkingDurationForNewYearsEve(DayLength.NOON);
-        when(settingsService.getSettings()).thenReturn(settings);
-
-        final Optional<PublicHoliday> maybePublicHoliday = sut.getPublicHoliday(of(2013, DECEMBER, 31), GERMANY_BADEN_WUERTTEMBERG);
-        assertThat(maybePublicHoliday).hasValueSatisfying(publicHoliday -> assertThat(publicHoliday.getWorkingDuration()).isEqualByComparingTo(BigDecimal.valueOf(0.5)));
-    }
-
-    @Test
-    void ensureWorkingDurationForChristmasEveCanBeConfiguredToAWorkingDurationOfZero() {
-
-        final Settings settings = new Settings();
-        settings.getWorkingTimeSettings().setWorkingDurationForChristmasEve(DayLength.ZERO);
-        when(settingsService.getSettings()).thenReturn(settings);
-
-        final Optional<PublicHoliday> maybePublicHoliday = sut.getPublicHoliday(of(2013, DECEMBER, 24), GERMANY_BADEN_WUERTTEMBERG);
-        assertThat(maybePublicHoliday).hasValueSatisfying(publicHoliday -> assertThat(publicHoliday.getWorkingDuration()).isEqualByComparingTo(ZERO));
-    }
-
-    @Test
-    void ensureWorkingDurationForNewYearsEveCanBeConfiguredToAWorkingDurationOfZero() {
-
-        final Settings settings = new Settings();
-        settings.getWorkingTimeSettings().setWorkingDurationForNewYearsEve(DayLength.ZERO);
-        when(settingsService.getSettings()).thenReturn(settings);
-
-        final Optional<PublicHoliday> maybePublicHoliday = sut.getPublicHoliday(of(2013, DECEMBER, 31), GERMANY_BADEN_WUERTTEMBERG);
-        assertThat(maybePublicHoliday).hasValueSatisfying(publicHoliday -> assertThat(publicHoliday.getWorkingDuration()).isEqualByComparingTo(ZERO));
-    }
 
     @Test
     void ensureCorrectWorkingDurationForAssumptionDayForBerlin() {
@@ -218,152 +178,10 @@ class PublicHolidaysServiceImplTest {
         final List<PublicHoliday> publicHolidays = sut.getPublicHolidays(of(2019, DECEMBER, 30), of(2019, DECEMBER, 31), GERMANY_BADEN_WUERTTEMBERG);
         assertThat(publicHolidays)
             .hasSize(1)
-            .extracting(p -> p.dayLength()).containsExactly(DayLength.NOON);
+            .extracting(PublicHoliday::dayLength)
+            .containsExactly(DayLength.NOON);
     }
 
-    // CHRISTMAS EVE
-    //
-
-    @Test
-    void ensurePublicHolidaysWithWorkingTimeSettingsForChristmasEveMorning() {
-
-        final LocalDate christmasEveDate = LocalDate.of(2022, DECEMBER, 24);
-
-        final WorkingTimeSettings workingTimeSettings = new WorkingTimeSettings();
-        workingTimeSettings.setWorkingDurationForChristmasEve(DayLength.MORNING);
-
-        final Optional<PublicHoliday> actual = sut.getPublicHoliday(christmasEveDate, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings);
-
-        assertThat(actual).isPresent();
-        assertThat(actual.get()).satisfies(publicHoliday -> {
-            assertThat(publicHoliday.date()).isEqualTo(christmasEveDate);
-            assertThat(publicHoliday.dayLength()).isEqualTo(DayLength.NOON);
-        });
-    }
-
-    @Test
-    void ensurePublicHolidaysWithWorkingTimeSettingsForChristmasEveNoon() {
-
-        final LocalDate christmasEveDate = LocalDate.of(2022, DECEMBER, 24);
-
-        final WorkingTimeSettings workingTimeSettings = new WorkingTimeSettings();
-        workingTimeSettings.setWorkingDurationForChristmasEve(DayLength.NOON);
-
-        final Optional<PublicHoliday> actual = sut.getPublicHoliday(christmasEveDate, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings);
-
-        assertThat(actual).isPresent();
-        assertThat(actual.get()).satisfies(publicHoliday -> {
-            assertThat(publicHoliday.date()).isEqualTo(christmasEveDate);
-            assertThat(publicHoliday.dayLength()).isEqualTo(DayLength.MORNING);
-        });
-    }
-
-    @Test
-    void ensurePublicHolidaysWithWorkingTimeSettingsForChristmasEveFull() {
-
-        final LocalDate christmasEveDate = LocalDate.of(2022, DECEMBER, 24);
-
-        final WorkingTimeSettings workingTimeSettings = new WorkingTimeSettings();
-        workingTimeSettings.setWorkingDurationForChristmasEve(DayLength.FULL);
-
-        final Optional<PublicHoliday> actual = sut.getPublicHoliday(christmasEveDate, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings);
-
-        assertThat(actual).isPresent();
-        assertThat(actual.get()).satisfies(publicHoliday -> {
-            assertThat(publicHoliday.date()).isEqualTo(christmasEveDate);
-            assertThat(publicHoliday.dayLength()).isEqualTo(DayLength.ZERO);
-        });
-    }
-
-    @Test
-    void ensurePublicHolidaysWithWorkingTimeSettingsForChristmasEveZero() {
-
-        final LocalDate christmasEveDate = LocalDate.of(2022, DECEMBER, 24);
-
-        final WorkingTimeSettings workingTimeSettings = new WorkingTimeSettings();
-        workingTimeSettings.setWorkingDurationForChristmasEve(DayLength.ZERO);
-
-        final Optional<PublicHoliday> actual = sut.getPublicHoliday(christmasEveDate, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings);
-
-        assertThat(actual).isPresent();
-        assertThat(actual.get()).satisfies(publicHoliday -> {
-            assertThat(publicHoliday.date()).isEqualTo(christmasEveDate);
-            assertThat(publicHoliday.dayLength()).isEqualTo(DayLength.FULL);
-        });
-    }
-
-    // NEW YEARS EVE
-    //
-
-    @Test
-    void ensurePublicHolidaysWithWorkingTimeSettingsForNewYearsEveMorning() {
-
-        final LocalDate newYearsEveDate = LocalDate.of(2022, DECEMBER, 31);
-
-        final WorkingTimeSettings workingTimeSettings = new WorkingTimeSettings();
-        workingTimeSettings.setWorkingDurationForNewYearsEve(DayLength.MORNING);
-
-        final Optional<PublicHoliday> actual = sut.getPublicHoliday(newYearsEveDate, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings);
-
-        assertThat(actual).isPresent();
-        assertThat(actual.get()).satisfies(publicHoliday -> {
-            assertThat(publicHoliday.date()).isEqualTo(newYearsEveDate);
-            assertThat(publicHoliday.dayLength()).isEqualTo(DayLength.NOON);
-        });
-    }
-
-    @Test
-    void ensurePublicHolidaysWithWorkingTimeSettingsForNewYearsEveNoon() {
-
-        final LocalDate newYearsEveDate = LocalDate.of(2022, DECEMBER, 31);
-
-        final WorkingTimeSettings workingTimeSettings = new WorkingTimeSettings();
-        workingTimeSettings.setWorkingDurationForNewYearsEve(DayLength.NOON);
-
-        final Optional<PublicHoliday> actual = sut.getPublicHoliday(newYearsEveDate, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings);
-
-        assertThat(actual).isPresent();
-        assertThat(actual.get()).satisfies(publicHoliday -> {
-            assertThat(publicHoliday.date()).isEqualTo(newYearsEveDate);
-            assertThat(publicHoliday.dayLength()).isEqualTo(DayLength.MORNING);
-        });
-    }
-
-    @Test
-    void ensurePublicHolidaysWithWorkingTimeSettingsForNewYearsEveFull() {
-
-        final LocalDate newYearsEveDate = LocalDate.of(2022, DECEMBER, 31);
-
-        final WorkingTimeSettings workingTimeSettings = new WorkingTimeSettings();
-        workingTimeSettings.setWorkingDurationForNewYearsEve(DayLength.FULL);
-
-        final Optional<PublicHoliday> actual = sut.getPublicHoliday(newYearsEveDate, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings);
-
-        assertThat(actual).isPresent();
-        assertThat(actual.get()).satisfies(publicHoliday -> {
-            assertThat(publicHoliday.date()).isEqualTo(newYearsEveDate);
-            assertThat(publicHoliday.dayLength()).isEqualTo(DayLength.ZERO);
-        });
-    }
-
-    @Test
-    void ensurePublicHolidaysWithWorkingTimeSettingsForNewYearsEveZero() {
-
-        final LocalDate newYearsEveDate = LocalDate.of(2022, DECEMBER, 31);
-
-        final WorkingTimeSettings workingTimeSettings = new WorkingTimeSettings();
-        workingTimeSettings.setWorkingDurationForNewYearsEve(DayLength.ZERO);
-
-        final Optional<PublicHoliday> actual = sut.getPublicHoliday(newYearsEveDate, GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings);
-
-        assertThat(actual).isPresent();
-        assertThat(actual.get()).satisfies(publicHoliday -> {
-            assertThat(publicHoliday.date()).isEqualTo(newYearsEveDate);
-            assertThat(publicHoliday.dayLength()).isEqualTo(DayLength.FULL);
-        });
-    }
-
-
     private HolidayManager getHolidayManager() {
         final ClassLoader cl = Thread.currentThread().getContextClassLoader();
         final URL url = cl.getResource("Holidays_de.xml");
diff --git a/src/test/java/org/synyx/urlaubsverwaltung/workingtime/WorkingTimeCalendarServiceImplTest.java b/src/test/java/org/synyx/urlaubsverwaltung/workingtime/WorkingTimeCalendarServiceImplTest.java
index 61f818df9..e56fd5746 100644
--- a/src/test/java/org/synyx/urlaubsverwaltung/workingtime/WorkingTimeCalendarServiceImplTest.java
+++ b/src/test/java/org/synyx/urlaubsverwaltung/workingtime/WorkingTimeCalendarServiceImplTest.java
@@ -94,8 +94,6 @@ class WorkingTimeCalendarServiceImplTest {
         when(workingTimeRepository.findByPersonIsInOrderByValidFromDesc(persons))
             .thenReturn(List.of(workingTimeEntity, workingTimeEntity2));
 
-        when(settingsService.getSettings()).thenReturn(new Settings());
-
         final Map<Person, WorkingTimeCalendar> actual = sut.getWorkingTimesByPersons(persons, Year.of(2022));
         assertThat(actual)
             .hasSize(2)
@@ -150,8 +148,6 @@ class WorkingTimeCalendarServiceImplTest {
         when(workingTimeRepository.findByPersonIsInOrderByValidFromDesc(persons))
             .thenReturn(List.of(workingTimeEntity, workingTimeEntity2));
 
-        when(settingsService.getSettings()).thenReturn(new Settings());
-
         final Map<Person, WorkingTimeCalendar> actual = sut.getWorkingTimesByPersons(persons, dateRange);
         assertThat(actual)
             .hasSize(2)
@@ -197,7 +193,7 @@ class WorkingTimeCalendarServiceImplTest {
 
         sut.getWorkingTimesByPersons(persons, Year.of(2022));
 
-        verify(publicHolidaysService, times(365)).getPublicHoliday(any(LocalDate.class), eq(GERMANY_BERLIN), eq(workingTimeSettings));
+        verify(publicHolidaysService, times(365)).getPublicHoliday(any(LocalDate.class), eq(GERMANY_BERLIN));
     }
 
     @Test
@@ -239,11 +235,10 @@ class WorkingTimeCalendarServiceImplTest {
         final Settings settings = new Settings();
         final WorkingTimeSettings workingTimeSettings = new WorkingTimeSettings();
         settings.setWorkingTimeSettings(workingTimeSettings);
-        when(settingsService.getSettings()).thenReturn(settings);
-        when(publicHolidaysService.getPublicHoliday(any(LocalDate.class), any(FederalState.class), eq(workingTimeSettings))).thenReturn(Optional.empty());
-        when(publicHolidaysService.getPublicHoliday(LocalDate.of(2022, AUGUST, 5), GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings))
+        when(publicHolidaysService.getPublicHoliday(any(LocalDate.class), any(FederalState.class))).thenReturn(Optional.empty());
+        when(publicHolidaysService.getPublicHoliday(LocalDate.of(2022, AUGUST, 5), GERMANY_BADEN_WUERTTEMBERG))
             .thenReturn(Optional.of(new PublicHoliday(LocalDate.of(2022, AUGUST, 5), FULL, "")));
-        when(publicHolidaysService.getPublicHoliday(LocalDate.of(2022, AUGUST, 10), GERMANY_BERLIN, workingTimeSettings))
+        when(publicHolidaysService.getPublicHoliday(LocalDate.of(2022, AUGUST, 10), GERMANY_BERLIN))
             .thenReturn(Optional.of(new PublicHoliday(LocalDate.of(2022, AUGUST, 10), FULL, "")));
 
         final Map<Person, WorkingTimeCalendar> actual = sut.getWorkingTimesByPersons(persons, Year.of(2022));
@@ -304,8 +299,6 @@ class WorkingTimeCalendarServiceImplTest {
         when(workingTimeRepository.findByPersonIsInOrderByValidFromDesc(persons))
             .thenReturn(List.of(workingTimeEntity, workingTimeNextYear));
 
-        when(settingsService.getSettings()).thenReturn(new Settings());
-
         final Map<Person, WorkingTimeCalendar> actual = sut.getWorkingTimesByPersons(persons, Year.of(2022));
         assertThat(actual)
             .hasSize(1)
@@ -353,8 +346,6 @@ class WorkingTimeCalendarServiceImplTest {
         when(workingTimeRepository.findByPersonIsInOrderByValidFromDesc(List.of(person)))
             .thenReturn(List.of(workingTimeLaterInYear, workingTimeEntity));
 
-        when(settingsService.getSettings()).thenReturn(new Settings());
-
         final Map<Person, WorkingTimeCalendar> actual = sut.getWorkingTimesByPersons(List.of(person), Year.of(2022));
         assertThat(actual)
             .hasSize(1)
@@ -377,8 +368,6 @@ class WorkingTimeCalendarServiceImplTest {
         final List<Person> persons = List.of(person);
         final DateRange dateRange = new DateRange(LocalDate.of(2022, JANUARY, 1), LocalDate.of(2022, DECEMBER, 31));
 
-        when(settingsService.getSettings()).thenReturn(new Settings());
-
         when(workingTimeRepository.findByPersonIsInOrderByValidFromDesc(persons)).thenReturn(List.of());
 
         final Map<Person, WorkingTimeCalendar> actual = sut.getWorkingTimesByPersons(persons, Year.of(2022));
@@ -412,13 +401,7 @@ class WorkingTimeCalendarServiceImplTest {
         workingTimeEntity.setFederalStateOverride(GERMANY_BADEN_WUERTTEMBERG);
         when(workingTimeRepository.findByPersonIsInOrderByValidFromDesc(persons)).thenReturn(List.of(workingTimeEntity));
 
-        final Settings settings = new Settings();
-        final WorkingTimeSettings workingTimeSettings = new WorkingTimeSettings();
-        workingTimeSettings.setWorkingDurationForChristmasEve(FULL);
-        settings.setWorkingTimeSettings(workingTimeSettings);
-        when(settingsService.getSettings()).thenReturn(settings);
-
-        when(publicHolidaysService.getPublicHoliday(LocalDate.of(2024, DECEMBER, 24), GERMANY_BADEN_WUERTTEMBERG, workingTimeSettings))
+        when(publicHolidaysService.getPublicHoliday(LocalDate.of(2024, DECEMBER, 24), GERMANY_BADEN_WUERTTEMBERG))
             .thenReturn(Optional.of(new PublicHoliday(LocalDate.of(2024, DECEMBER, 24), ZERO, "")));
 
         final Map<Person, WorkingTimeCalendar> actual = sut.getWorkingTimesByPersons(persons, new DateRange(LocalDate.of(2024, 12, 24), LocalDate.of(2024, 12, 24)));