Skip to content

Commit

Permalink
Fix mockito usage
Browse files Browse the repository at this point in the history
  • Loading branch information
sjohnr committed Sep 1, 2023
1 parent ea1ec64 commit 1a45602
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public void httpBasicWhenUsingDefaultsThenResponseIncludesBasicChallenge() throw

@Test
public void httpBasicWhenUsingCustomAuthenticationEntryPointThenResponseIncludesBasicChallenge() throws Exception {
CustomAuthenticationEntryPointConfig.ENTRY_POINT = mock(AuthenticationEntryPoint.class);
this.spring.register(CustomAuthenticationEntryPointConfig.class).autowire();
this.mvc.perform(get("/"));
verify(CustomAuthenticationEntryPointConfig.ENTRY_POINT).commence(any(HttpServletRequest.class),
Expand Down Expand Up @@ -239,7 +240,7 @@ UserDetailsService userDetailsService() {
@EnableWebSecurity
static class CustomAuthenticationEntryPointConfig {

static AuthenticationEntryPoint ENTRY_POINT = mock(AuthenticationEntryPoint.class);
static AuthenticationEntryPoint ENTRY_POINT;

@Bean
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
Expand Down

0 comments on commit 1a45602

Please sign in to comment.