diff --git a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/exception/ExceptionConstants.java b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/exception/ExceptionConstants.java index 1c5283353..8cf6ba839 100644 --- a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/exception/ExceptionConstants.java +++ b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/exception/ExceptionConstants.java @@ -51,16 +51,16 @@ public class ExceptionConstants { public static ExceptionDataWrapper GETREFERENDUMVORLAGEN_PARAMETER_UNVOLLSTAENDIG = new ExceptionDataWrapper("308", "getReferendumvorlagen: Suchkriterien unvollständig."); - public static ExceptionDataWrapper CODE_GETWAHLEN_PARAMETER_UNVOLLSTAENDIG = new ExceptionDataWrapper("314", + public static ExceptionDataWrapper GETWAHLEN_PARAMETER_UNVOLLSTAENDIG = new ExceptionDataWrapper("314", "getWahlen: Der Wahltag zu den gesuchten Wahlen existiert nicht."); - public static ExceptionDataWrapper CODE_POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG = new ExceptionDataWrapper("317", + public static ExceptionDataWrapper POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG = new ExceptionDataWrapper("317", "postWahlen: Suchkriterien unvollständig. Die wahltagID ist leer oder null."); - public static ExceptionDataWrapper CODE_POSTWAHLEN_UNSAVEABLE = new ExceptionDataWrapper("318", + public static ExceptionDataWrapper POSTWAHLEN_UNSAVEABLE = new ExceptionDataWrapper("318", "postWahlen: Die Wahlen konnten nicht gespeichert werden."); public static ExceptionDataWrapper CODE_GETWAHLBEZIRKE_PARAMETER_UNVOLLSTAENDIG = new ExceptionDataWrapper("312", "getWahlbezirke: Suchkriterien unvollständig. Die wahltagID ist leer oder null."); - public static ExceptionDataWrapper CODE_GETWAHLBEZIRKE_NO_WAHLTAG = new ExceptionDataWrapper("313", + public static ExceptionDataWrapper GETWAHLBEZIRKE_NO_WAHLTAG = new ExceptionDataWrapper("313", "Es wurde kein Wahltag zu dieser WahltagID gefunden. Bitte legen Sie die Basisdaten an."); public static final ExceptionDataWrapper GETKOPFDATEN_PARAMETER_UNVOLLSTAENDIG = new ExceptionDataWrapper("303", diff --git a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeService.java b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeService.java index 863d0b9e5..055e79c1d 100644 --- a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeService.java +++ b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeService.java @@ -59,7 +59,7 @@ public List getWahlbezirke(final String wahltagID) { } return wahlbezirkModelMapper.fromListOfWahlbezirkEntityToListOfWahlbezirkModel(wahlbezirkRepository.findByWahltag(wahltagObjekt.getWahltag())); } else { - throw exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_GETWAHLBEZIRKE_NO_WAHLTAG); + throw exceptionFactory.createFachlicheWlsException(ExceptionConstants.GETWAHLBEZIRKE_NO_WAHLTAG); } } } diff --git a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeValidator.java b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeValidator.java index 1b27b038e..8603694f5 100644 --- a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeValidator.java +++ b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeValidator.java @@ -22,7 +22,7 @@ public void validWahltagIDParamOrThrow(final String wahltagID) { public void validateWahltagForSearchingWahltagID(final Optional wahltag) { if (wahltag.isEmpty() || null == wahltag.get().getWahltag()) { - throw exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_GETWAHLBEZIRKE_NO_WAHLTAG); + throw exceptionFactory.createFachlicheWlsException(ExceptionConstants.GETWAHLBEZIRKE_NO_WAHLTAG); } } diff --git a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenService.java b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenService.java index 715d67902..882b21881 100644 --- a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenService.java +++ b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenService.java @@ -57,7 +57,7 @@ public void postWahlen(final WahlenWriteModel wahlenWriteModel) { wahlRepository.saveAll(wahlModelMapper.fromListOfWahlModeltoListOfWahlEntities(wahlenWriteModel.wahlen())); } catch (Exception e) { log.error("#postWahlen: Die Wahlen konnten aufgrund eines Fehlers nicht gespeichert werden:", e); - throw exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_POSTWAHLEN_UNSAVEABLE); + throw exceptionFactory.createFachlicheWlsException(ExceptionConstants.POSTWAHLEN_UNSAVEABLE); } } diff --git a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenValidator.java b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenValidator.java index 68080e49f..971e0ff9a 100644 --- a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenValidator.java +++ b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenValidator.java @@ -15,13 +15,13 @@ public class WahlenValidator { public void validWahlenCriteriaOrThrow(final String wahltagID) { if (StringUtils.isBlank(wahltagID)) { - throw exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_GETWAHLEN_PARAMETER_UNVOLLSTAENDIG); + throw exceptionFactory.createFachlicheWlsException(ExceptionConstants.GETWAHLEN_PARAMETER_UNVOLLSTAENDIG); } } public void validWahlenWriteModelOrThrow(final WahlenWriteModel wahlenWriteModel) { if (wahlenWriteModel == null || StringUtils.isBlank(wahlenWriteModel.wahltagID()) || CollectionUtils.isEmpty(wahlenWriteModel.wahlen())) { - throw exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG); + throw exceptionFactory.createFachlicheWlsException(ExceptionConstants.POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG); } } diff --git a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahltag/WahltageService.java b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahltag/WahltageService.java index b846781dd..8e852a6af 100644 --- a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahltag/WahltageService.java +++ b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahltag/WahltageService.java @@ -44,6 +44,6 @@ public WahltagModel getWahltagByID(final String wahltagID) { private Wahltag getWahltagByIDOrThrow(final String wahltagID) { return wahltagRepository.findById(wahltagID) - .orElseThrow(() -> exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_GETWAHLBEZIRKE_NO_WAHLTAG)); + .orElseThrow(() -> exceptionFactory.createFachlicheWlsException(ExceptionConstants.GETWAHLBEZIRKE_NO_WAHLTAG)); } } diff --git a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/wahlen/WahlenControllerIntegrationTest.java b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/wahlen/WahlenControllerIntegrationTest.java index 6715f7462..81a26f508 100644 --- a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/wahlen/WahlenControllerIntegrationTest.java +++ b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/wahlen/WahlenControllerIntegrationTest.java @@ -4,10 +4,10 @@ import static de.muenchen.oss.wahllokalsystem.basisdatenservice.TestConstants.SPRING_TEST_PROFILE; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + import com.fasterxml.jackson.databind.ObjectMapper; import com.github.tomakehurst.wiremock.client.WireMock; import de.muenchen.oss.wahllokalsystem.basisdatenservice.MicroServiceApplication; - import de.muenchen.oss.wahllokalsystem.basisdatenservice.clients.WahlenClientMapper; import de.muenchen.oss.wahllokalsystem.basisdatenservice.domain.Wahltag; import de.muenchen.oss.wahllokalsystem.basisdatenservice.domain.WahltagRepository; @@ -234,8 +234,8 @@ void fachlicheWlsExceptionWhenRequestIsInvalid() throws Exception { val response = api.perform(request).andExpect(status().isBadRequest()).andReturn(); val responseBodyAsWlsExceptionDTO = objectMapper.readValue(response.getResponse().getContentAsByteArray(), WlsExceptionDTO.class); - val expectedWlsExceptionDTO = new WlsExceptionDTO(WlsExceptionCategory.F, ExceptionConstants.CODE_POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG.code(), - serviceID, ExceptionConstants.CODE_POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG.message()); + val expectedWlsExceptionDTO = new WlsExceptionDTO(WlsExceptionCategory.F, ExceptionConstants.POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG.code(), + serviceID, ExceptionConstants.POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG.message()); Assertions.assertThat(responseBodyAsWlsExceptionDTO).isEqualTo(expectedWlsExceptionDTO); } diff --git a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeServiceTest.java b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeServiceTest.java index b8353344a..ce6234e79 100644 --- a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeServiceTest.java +++ b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeServiceTest.java @@ -56,7 +56,7 @@ void throwsFachlicheWlsExceptionIfNoWahltagPresentInRepository() { val wahltagID = "_identifikatorWahltag1"; Mockito.when(wahltagRepository.findById(wahltagID)).thenReturn(Optional.empty()); val mockedWlsException = FachlicheWlsException.withCode("").buildWithMessage(""); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_GETWAHLBEZIRKE_NO_WAHLTAG)) + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.GETWAHLBEZIRKE_NO_WAHLTAG)) .thenReturn(mockedWlsException); Assertions.assertThatThrownBy(() -> unitUnderTest.getWahlbezirke(wahltagID)).isInstanceOf(FachlicheWlsException.class); Mockito.verify(wahlbezirkeValidator).validWahltagIDParamOrThrow(wahltagID); diff --git a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeValidatorTest.java b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeValidatorTest.java index dbc842de7..a957e1415 100644 --- a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeValidatorTest.java +++ b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlbezirke/WahlbezirkeValidatorTest.java @@ -64,7 +64,7 @@ void exceptionWhenWahlIDisEmptyOrHasNoWahltagProperty() { val noWahltagRequestParam = MockDataFactory.createWahltagList("").stream().findFirst(); noWahltagRequestParam.ifPresent(wahltag -> wahltag.setWahltag(null)); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_GETWAHLBEZIRKE_NO_WAHLTAG)) + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.GETWAHLBEZIRKE_NO_WAHLTAG)) .thenReturn(mockedWlsException); Assertions.assertThatThrownBy(() -> unitUnderTest.validateWahltagForSearchingWahltagID(emptyRequestParam)).isSameAs(mockedWlsException); Assertions.assertThatThrownBy(() -> unitUnderTest.validateWahltagForSearchingWahltagID(noWahltagRequestParam)).isSameAs(mockedWlsException); diff --git a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenServiceTest.java b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenServiceTest.java index ae0f996ce..a86efb9f1 100644 --- a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenServiceTest.java +++ b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenServiceTest.java @@ -120,7 +120,7 @@ void wlsExceptionWhenSavingFailed() { Mockito.when(wahlModelMapper.fromListOfWahlModeltoListOfWahlEntities(mockedListOfModels)).thenReturn(mockedListOfEntities); Mockito.doThrow(mockedRepoSaveException).when(wahlRepository).saveAll(mockedListOfEntities); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_POSTWAHLEN_UNSAVEABLE)) + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.POSTWAHLEN_UNSAVEABLE)) .thenReturn(mockedWlsException); Assertions.assertThatThrownBy(() -> unitUnderTest.postWahlen(wahlenToWrite)).isSameAs(mockedWlsException); diff --git a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenValidatorTest.java b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenValidatorTest.java index 28aec91af..dc7bf80dd 100644 --- a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenValidatorTest.java +++ b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenValidatorTest.java @@ -36,7 +36,7 @@ void noExceptionWhenCriteriaIsValid() { void exceptionWhenCriteriaIsNull() { val mockedException = FachlicheWlsException.withCode("").buildWithMessage(""); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_GETWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.GETWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); Assertions.assertThatThrownBy(() -> unitUnderTest.validWahlenCriteriaOrThrow(null)).isSameAs(mockedException); } @@ -45,7 +45,7 @@ void exceptionWhenCriteriaIsNull() { void exceptionWhenCriteriaIsEmpty() { val mockedException = FachlicheWlsException.withCode("").buildWithMessage(""); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_GETWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.GETWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); Assertions.assertThatThrownBy(() -> unitUnderTest.validWahlenCriteriaOrThrow("")).isSameAs(mockedException); } @@ -54,7 +54,7 @@ void exceptionWhenCriteriaIsEmpty() { void exceptionWhenCriteriaIsBlank() { val mockedException = FachlicheWlsException.withCode("").buildWithMessage(""); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_GETWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.GETWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); Assertions.assertThatThrownBy(() -> unitUnderTest.validWahlenCriteriaOrThrow(" ")).isSameAs(mockedException); } @@ -74,7 +74,7 @@ void noExceptionWhenModelIsValid() { void exceptionWhenWahltagIDIsNull() { val mockedException = FachlicheWlsException.withCode("").buildWithMessage(""); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); val invalidModel = new WahlenWriteModel(null, List.of(createEmptyWahlModel())); @@ -85,7 +85,7 @@ void exceptionWhenWahltagIDIsNull() { void exceptionWhenWahltagIDIsEmpty() { val mockedException = FachlicheWlsException.withCode("").buildWithMessage(""); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); val invalidModel = new WahlenWriteModel("", List.of(createEmptyWahlModel())); @@ -96,7 +96,7 @@ void exceptionWhenWahltagIDIsEmpty() { void exceptionWhenWahltagIDIsBlank() { val mockedException = FachlicheWlsException.withCode("").buildWithMessage(""); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); val invalidModel = new WahlenWriteModel(" ", List.of(createEmptyWahlModel())); @@ -107,7 +107,7 @@ void exceptionWhenWahltagIDIsBlank() { void exceptionWhenWahlenIsNull() { val mockedException = FachlicheWlsException.withCode("").buildWithMessage(""); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); val invalidModel = new WahlenWriteModel("wahltagID", null); @@ -118,7 +118,7 @@ void exceptionWhenWahlenIsNull() { void exceptionWhenWahlenIsEmpty() { val mockedException = FachlicheWlsException.withCode("").buildWithMessage(""); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.POSTWAHLEN_PARAMETER_UNVOLLSTAENDIG)).thenReturn(mockedException); val invalidModel = new WahlenWriteModel("wahltagID", Collections.emptyList()); diff --git a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahltag/WahltageServiceTest.java b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahltag/WahltageServiceTest.java index 521b1968d..90332be1f 100644 --- a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahltag/WahltageServiceTest.java +++ b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahltag/WahltageServiceTest.java @@ -98,7 +98,7 @@ void exceptionWhenNotFound() { val mockedWlsException = FachlicheWlsException.withCode("").buildWithMessage(""); Mockito.when(wahltagRepository.findById(wahltagID)).thenReturn(Optional.empty()); - Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.CODE_GETWAHLBEZIRKE_NO_WAHLTAG)).thenReturn(mockedWlsException); + Mockito.when(exceptionFactory.createFachlicheWlsException(ExceptionConstants.GETWAHLBEZIRKE_NO_WAHLTAG)).thenReturn(mockedWlsException); Assertions.assertThatException().isThrownBy(() -> unitUnderTest.getWahltagByID(wahltagID)).isSameAs(mockedWlsException); }