mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-01 17:52:13 +00:00
Fix mockito usage
This commit is contained in:
parent
ea1ec646b2
commit
1a45602dbb
@ -107,6 +107,7 @@ public class HttpBasicConfigurerTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void httpBasicWhenUsingCustomAuthenticationEntryPointThenResponseIncludesBasicChallenge() throws Exception {
|
public void httpBasicWhenUsingCustomAuthenticationEntryPointThenResponseIncludesBasicChallenge() throws Exception {
|
||||||
|
CustomAuthenticationEntryPointConfig.ENTRY_POINT = mock(AuthenticationEntryPoint.class);
|
||||||
this.spring.register(CustomAuthenticationEntryPointConfig.class).autowire();
|
this.spring.register(CustomAuthenticationEntryPointConfig.class).autowire();
|
||||||
this.mvc.perform(get("/"));
|
this.mvc.perform(get("/"));
|
||||||
verify(CustomAuthenticationEntryPointConfig.ENTRY_POINT).commence(any(HttpServletRequest.class),
|
verify(CustomAuthenticationEntryPointConfig.ENTRY_POINT).commence(any(HttpServletRequest.class),
|
||||||
@ -239,7 +240,7 @@ public class HttpBasicConfigurerTests {
|
|||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
static class CustomAuthenticationEntryPointConfig {
|
static class CustomAuthenticationEntryPointConfig {
|
||||||
|
|
||||||
static AuthenticationEntryPoint ENTRY_POINT = mock(AuthenticationEntryPoint.class);
|
static AuthenticationEntryPoint ENTRY_POINT;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user