Skip to content

Commit

Permalink
Fix mockito 4.7.0 merge
Browse files Browse the repository at this point in the history
Issue gh-11748
  • Loading branch information
rwinch committed Aug 24, 2022
1 parent 232838b commit 32dbace
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;

/**
* Tests {@link CasAuthenticationFilter}.
Expand Down Expand Up @@ -177,7 +176,7 @@ public void testDoFilterAuthenticateAll() throws Exception {
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNotNull()
.withFailMessage("Authentication should not be null");
verify(chain).doFilter(request, response);
verifyZeroInteractions(successHandler);
verifyNoMoreInteractions(successHandler);
// validate for when the filterProcessUrl matches
filter.setFilterProcessesUrl(request.getServletPath());
SecurityContextHolder.clearContext();
Expand Down Expand Up @@ -229,7 +228,7 @@ public void testChainNotInvokedForProxyReceptor() throws Exception {
filter.setProxyGrantingTicketStorage(mock(ProxyGrantingTicketStorage.class));
filter.setProxyReceptorUrl(request.getServletPath());
filter.doFilter(request, response, chain);
verifyZeroInteractions(chain);
verifyNoMoreInteractions(chain);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void doFilterWhenAuthorizationRequestImplicitGrantThenRedirectForAuthoriz
MockHttpServletResponse response = new MockHttpServletResponse();
FilterChain filterChain = mock(FilterChain.class);
this.filter.doFilter(request, response, filterChain);
verifyZeroInteractions(filterChain);
verifyNoMoreInteractions(filterChain);
assertThat(response.getRedirectedUrl()).matches("https://example.com/login/oauth/authorize\\?"
+ "response_type=token&client_id=client-id&" + "scope=read:user&state=.{15,}&"
+ "redirect_uri=http://localhost/authorize/oauth2/implicit/registration-3");
Expand All @@ -214,7 +214,7 @@ public void doFilterWhenAuthorizationRequestImplicitGrantThenAuthorizationReques
AuthorizationRequestRepository.class);
this.filter.setAuthorizationRequestRepository(authorizationRequestRepository);
this.filter.doFilter(request, response, filterChain);
verifyZeroInteractions(filterChain);
verifyNoMoreInteractions(filterChain);
verify(authorizationRequestRepository, times(0)).saveAuthorizationRequest(any(OAuth2AuthorizationRequest.class),
any(HttpServletRequest.class), any(HttpServletResponse.class));
}
Expand Down

0 comments on commit 32dbace

Please sign in to comment.