From 1a45602dbb7b71ddb66bb975bd83a12ee1e1a4de Mon Sep 17 00:00:00 2001 From: Steve Riesenberg Date: Fri, 1 Sep 2023 12:42:39 -0500 Subject: [PATCH] Fix mockito usage --- .../annotation/web/configurers/HttpBasicConfigurerTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurerTests.java index 6cf47b3639..581c11bab8 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurerTests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurerTests.java @@ -107,6 +107,7 @@ public class HttpBasicConfigurerTests { @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), @@ -239,7 +240,7 @@ public class HttpBasicConfigurerTests { @EnableWebSecurity static class CustomAuthenticationEntryPointConfig { - static AuthenticationEntryPoint ENTRY_POINT = mock(AuthenticationEntryPoint.class); + static AuthenticationEntryPoint ENTRY_POINT; @Bean SecurityFilterChain filterChain(HttpSecurity http) throws Exception {