From 12a0ccf6de9c3324b1e44dc848caa85c7bed2006 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Thu, 22 Sep 2022 16:15:02 -0500 Subject: [PATCH] Remove Explicit CSRF Config from DeferHttpSessionTests Issue gh-11764 --- .../web/configuration/DeferHttpSessionJavaConfigTests.java | 6 ------ .../config/http/DeferHttpSessionTests-Explicit.xml | 7 ------- 2 files changed, 13 deletions(-) diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/DeferHttpSessionJavaConfigTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/DeferHttpSessionJavaConfigTests.java index 92ad4b5e2c..6c5063bca6 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/web/configuration/DeferHttpSessionJavaConfigTests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/web/configuration/DeferHttpSessionJavaConfigTests.java @@ -32,8 +32,6 @@ import org.springframework.security.config.test.SpringTestContext; import org.springframework.security.config.test.SpringTestContextExtension; import org.springframework.security.web.DefaultSecurityFilterChain; import org.springframework.security.web.FilterChainProxy; -import org.springframework.security.web.csrf.CsrfTokenRepository; -import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.Mockito.never; @@ -78,7 +76,6 @@ public class DeferHttpSessionJavaConfigTests { @Bean DefaultSecurityFilterChain springSecurity(HttpSecurity http) throws Exception { - CsrfTokenRepository csrfRepository = new HttpSessionCsrfTokenRepository(); // @formatter:off http .authorizeHttpRequests((requests) -> requests @@ -86,9 +83,6 @@ public class DeferHttpSessionJavaConfigTests { ) .sessionManagement((sessions) -> sessions .requireExplicitAuthenticationStrategy(true) - ) - .csrf((csrf) -> csrf - .csrfTokenRepository(csrfRepository) ); // @formatter:on return http.build(); diff --git a/config/src/test/resources/org/springframework/security/config/http/DeferHttpSessionTests-Explicit.xml b/config/src/test/resources/org/springframework/security/config/http/DeferHttpSessionTests-Explicit.xml index 23411a7e77..0850ea6c6f 100644 --- a/config/src/test/resources/org/springframework/security/config/http/DeferHttpSessionTests-Explicit.xml +++ b/config/src/test/resources/org/springframework/security/config/http/DeferHttpSessionTests-Explicit.xml @@ -29,18 +29,11 @@ - - - -