Skip to content

Commit

Permalink
fixing tests for spring-boot 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSebastian committed May 27, 2024
1 parent 002a1c8 commit b23d080
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void bezirkIDPermissionEvaluatorFailed() {
Mockito.when(bezirkIDPermissionEvaluator.tokenUserBezirkIdMatches(Mockito.eq(wahlbezirkID), Mockito.any())).thenReturn(false);

Assertions.assertThatThrownBy(() -> beanstandeteWahlbriefeService.getBeanstandeteWahlbriefe(beanstandeteWahlbriefeReference))
.isExactlyInstanceOf(AccessDeniedException.class);
.isInstanceOf(AccessDeniedException.class);
}

@ParameterizedTest(name = "{index} - {1} missing")
Expand All @@ -82,7 +82,7 @@ void anyMissingAuthorityCausesFail(final ArgumentsAccessor argumentsAccessor) {
Mockito.when(bezirkIDPermissionEvaluator.tokenUserBezirkIdMatches(Mockito.eq(wahlbezirkID), Mockito.any())).thenReturn(true);

Assertions.assertThatThrownBy(() -> beanstandeteWahlbriefeService.getBeanstandeteWahlbriefe(beanstandeteWahlbriefeReference))
.isExactlyInstanceOf(AccessDeniedException.class);
.isInstanceOf(AccessDeniedException.class);
}

private static Stream<Arguments> getMissingAuthoritiesVariations() {
Expand Down Expand Up @@ -121,7 +121,7 @@ void bezirkIDPermissionEvaluatorFailed() {
Mockito.when(bezirkIDPermissionEvaluator.tokenUserBezirkIdMatches(Mockito.eq(wahlbezirkID), Mockito.any())).thenReturn(false);

Assertions.assertThatThrownBy(() -> beanstandeteWahlbriefeService.setBeanstandeteWahlbriefe(beanstandeteWahlbriefeModel))
.isExactlyInstanceOf(AccessDeniedException.class);
.isInstanceOf(AccessDeniedException.class);
}

@ParameterizedTest(name = "{index} - {1} missing")
Expand All @@ -135,7 +135,7 @@ void anyMissingAuthorityCausesFail(final ArgumentsAccessor argumentsAccessor) {
Mockito.when(bezirkIDPermissionEvaluator.tokenUserBezirkIdMatches(Mockito.eq(wahlbezirkID), Mockito.any())).thenReturn(true);

Assertions.assertThatThrownBy(() -> beanstandeteWahlbriefeService.setBeanstandeteWahlbriefe(beanstandeteWahlbriefeModel))
.isExactlyInstanceOf(AccessDeniedException.class);
.isInstanceOf(AccessDeniedException.class);
}

private static Stream<Arguments> getMissingAuthoritiesVariations() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void bezirkIDPermissionEvaluatorFailed() {
Mockito.when(bezirkIDPermissionEvaluator.tokenUserBezirkIdMatches(Mockito.eq(wahlbezirkID), Mockito.any())).thenReturn(false);

Assertions.assertThatException().isThrownBy(() -> unitUnderTest.getUrnenwahlvorbereitung(wahlbezirkID))
.isExactlyInstanceOf(AccessDeniedException.class);
.isInstanceOf(AccessDeniedException.class);
}

@ParameterizedTest(name = "{index} - {1} missing")
Expand All @@ -73,7 +73,7 @@ void anyMissingAuthorityCausesFail(final ArgumentsAccessor argumentsAccessor) {
Mockito.when(bezirkIDPermissionEvaluator.tokenUserBezirkIdMatches(Mockito.eq(wahlbezirkID), Mockito.any())).thenReturn(true);

Assertions.assertThatThrownBy(() -> unitUnderTest.getUrnenwahlvorbereitung(wahlbezirkID))
.isExactlyInstanceOf(AccessDeniedException.class);
.isInstanceOf(AccessDeniedException.class);
}

private static Stream<Arguments> getMissingAuthoritiesVariations() {
Expand Down

0 comments on commit b23d080

Please sign in to comment.