parent
232838bf50
commit
32dbaceec5
|
@ -46,7 +46,6 @@ import static org.mockito.BDDMockito.given;
|
|||
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}.
|
||||
|
@ -177,7 +176,7 @@ public class CasAuthenticationFilterTests {
|
|||
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();
|
||||
|
@ -229,7 +228,7 @@ public class CasAuthenticationFilterTests {
|
|||
filter.setProxyGrantingTicketStorage(mock(ProxyGrantingTicketStorage.class));
|
||||
filter.setProxyReceptorUrl(request.getServletPath());
|
||||
filter.doFilter(request, response, chain);
|
||||
verifyZeroInteractions(chain);
|
||||
verifyNoMoreInteractions(chain);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ public class OAuth2AuthorizationRequestRedirectFilterTests {
|
|||
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");
|
||||
|
@ -214,7 +214,7 @@ public class OAuth2AuthorizationRequestRedirectFilterTests {
|
|||
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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue