diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/builders/TestHttpSecurity.java b/config/src/test/java/org/springframework/security/config/annotation/web/builders/TestHttpSecurities.java similarity index 95% rename from config/src/test/java/org/springframework/security/config/annotation/web/builders/TestHttpSecurity.java rename to config/src/test/java/org/springframework/security/config/annotation/web/builders/TestHttpSecurities.java index d55d978cabf..b123ce25cdd 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/web/builders/TestHttpSecurity.java +++ b/config/src/test/java/org/springframework/security/config/annotation/web/builders/TestHttpSecurities.java @@ -21,9 +21,9 @@ import org.springframework.security.config.annotation.web.configurers.DefaultLoginPageConfigurer; import org.springframework.test.util.ReflectionTestUtils; -public final class TestHttpSecurity { +public final class TestHttpSecurities { - private TestHttpSecurity() { + private TestHttpSecurities() { } diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.java index d551a2e3058..e5a3b3cc0b8 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.java @@ -31,7 +31,7 @@ import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.TestHttpSecurity; +import org.springframework.security.config.annotation.web.builders.TestHttpSecurities; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer; import org.springframework.security.config.test.SpringTestContext; @@ -169,7 +169,7 @@ static class NullWebInvocationPrivilegeEvaluatorConfig { @Bean SecurityFilterChain filterChain(HttpSecurity http) throws Exception { - TestHttpSecurity.disableDefaults(http); + TestHttpSecurities.disableDefaults(http); http.formLogin(); return http.build(); } diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.java index 19caf278ef6..36920cd85a1 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.java @@ -32,7 +32,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.TestHttpSecurity; +import org.springframework.security.config.annotation.web.builders.TestHttpSecurities; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.test.SpringTestContext; import org.springframework.security.config.test.SpringTestContextExtension; @@ -140,7 +140,7 @@ static class CustomFilterPositionConfig { @Bean SecurityFilterChain filterChain(HttpSecurity http) throws Exception { // @formatter:off - TestHttpSecurity.disableDefaults(http); + TestHttpSecurities.disableDefaults(http); http // this works so long as the CustomFilter extends one of the standard filters // if not, use addFilterBefore or addFilterAfter @@ -158,7 +158,7 @@ static class CustomFilterPositionAtConfig { @Bean SecurityFilterChain filterChain(HttpSecurity http) throws Exception { // @formatter:off - TestHttpSecurity.disableDefaults(http); + TestHttpSecurities.disableDefaults(http); http .addFilterAt(new OtherCustomFilter(), UsernamePasswordAuthenticationFilter.class); return http.build(); @@ -179,7 +179,7 @@ AuthenticationManager authenticationManager() { @Bean SecurityFilterChain filterChain(HttpSecurity http) throws Exception { // @formatter:off - TestHttpSecurity.disableDefaults(http); + TestHttpSecurities.disableDefaults(http); http .authorizeRequests() .anyRequest().hasRole("USER") diff --git a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SecurityContextConfigurerTests.java b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SecurityContextConfigurerTests.java index 5de55764f45..31c6fbfc665 100644 --- a/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SecurityContextConfigurerTests.java +++ b/config/src/test/java/org/springframework/security/config/annotation/web/configurers/SecurityContextConfigurerTests.java @@ -31,7 +31,7 @@ import org.springframework.security.config.ObjectPostProcessor; import org.springframework.security.config.TestDeferredSecurityContext; import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.TestHttpSecurity; +import org.springframework.security.config.annotation.web.builders.TestHttpSecurities; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.test.SpringTestContext; import org.springframework.security.config.test.SpringTestContextExtension; @@ -199,7 +199,7 @@ static class SecurityContextRepositoryDefaultsSecurityContextRepositoryConfig { @Bean SecurityFilterChain filterChain(HttpSecurity http) throws Exception { - TestHttpSecurity.disableDefaults(http); + TestHttpSecurities.disableDefaults(http); // @formatter:off http .addFilter(new WebAsyncManagerIntegrationFilter()) diff --git a/web/src/test/java/org/springframework/security/web/access/RequestMatcherDelegatingWebInvocationPrivilegeEvaluatorTests.java b/web/src/test/java/org/springframework/security/web/access/RequestMatcherDelegatingWebInvocationPrivilegeEvaluatorTests.java index b2417ec3aae..8847cfa93ef 100644 --- a/web/src/test/java/org/springframework/security/web/access/RequestMatcherDelegatingWebInvocationPrivilegeEvaluatorTests.java +++ b/web/src/test/java/org/springframework/security/web/access/RequestMatcherDelegatingWebInvocationPrivilegeEvaluatorTests.java @@ -75,7 +75,7 @@ void isAllowedWhenDelegatesEmptyThenAllowed() { @Test void isAllowedWhenNotMatchThenAllowed() { RequestMatcherEntry> notMatch = entry(this.alwaysDeny, - TestWebInvocationPrivilegeEvaluator.alwaysAllow()); + TestWebInvocationPrivilegeEvaluators.alwaysAllow()); WebInvocationPrivilegeEvaluator delegating = evaluator(notMatch); assertThat(delegating.isAllowed(this.uri, this.authentication)).isTrue(); verify(notMatch.getRequestMatcher()).matches(any()); @@ -96,9 +96,9 @@ void isAllowedWhenPrivilegeEvaluatorDenyThenAllowedFalse() { @Test void isAllowedWhenNotMatchThenMatchThenOnlySecondDelegateInvoked() { RequestMatcherEntry> notMatchDelegate = entry(this.alwaysDeny, - TestWebInvocationPrivilegeEvaluator.alwaysAllow()); + TestWebInvocationPrivilegeEvaluators.alwaysAllow()); RequestMatcherEntry> matchDelegate = entry(this.alwaysMatch, - TestWebInvocationPrivilegeEvaluator.alwaysAllow()); + TestWebInvocationPrivilegeEvaluators.alwaysAllow()); RequestMatcherEntry> spyNotMatchDelegate = spy(notMatchDelegate); RequestMatcherEntry> spyMatchDelegate = spy(matchDelegate); @@ -120,8 +120,8 @@ void isAllowedWhenDelegatePrivilegeEvaluatorsEmptyThenAllowedTrue() { @Test void isAllowedWhenFirstDelegateDenyThenDoNotInvokeOthers() { - WebInvocationPrivilegeEvaluator deny = TestWebInvocationPrivilegeEvaluator.alwaysDeny(); - WebInvocationPrivilegeEvaluator allow = TestWebInvocationPrivilegeEvaluator.alwaysAllow(); + WebInvocationPrivilegeEvaluator deny = TestWebInvocationPrivilegeEvaluators.alwaysDeny(); + WebInvocationPrivilegeEvaluator allow = TestWebInvocationPrivilegeEvaluators.alwaysAllow(); WebInvocationPrivilegeEvaluator spyDeny = spy(deny); WebInvocationPrivilegeEvaluator spyAllow = spy(allow); RequestMatcherEntry> delegate = entry(this.alwaysMatch, spyDeny, @@ -136,7 +136,7 @@ void isAllowedWhenFirstDelegateDenyThenDoNotInvokeOthers() { @Test void isAllowedWhenDifferentArgumentsThenCallSpecificIsAllowedInDelegate() { - WebInvocationPrivilegeEvaluator deny = TestWebInvocationPrivilegeEvaluator.alwaysDeny(); + WebInvocationPrivilegeEvaluator deny = TestWebInvocationPrivilegeEvaluators.alwaysDeny(); WebInvocationPrivilegeEvaluator spyDeny = spy(deny); RequestMatcherEntry> delegate = entry(this.alwaysMatch, spyDeny); @@ -197,11 +197,11 @@ private RequestMatcherDelegatingWebInvocationPrivilegeEvaluator evaluator(Reques } private RequestMatcherEntry> allow(RequestMatcher requestMatcher) { - return entry(requestMatcher, TestWebInvocationPrivilegeEvaluator.alwaysAllow()); + return entry(requestMatcher, TestWebInvocationPrivilegeEvaluators.alwaysAllow()); } private RequestMatcherEntry> deny(RequestMatcher requestMatcher) { - return entry(requestMatcher, TestWebInvocationPrivilegeEvaluator.alwaysDeny()); + return entry(requestMatcher, TestWebInvocationPrivilegeEvaluators.alwaysDeny()); } private RequestMatcherEntry> entry(RequestMatcher requestMatcher, diff --git a/web/src/test/java/org/springframework/security/web/access/TestWebInvocationPrivilegeEvaluator.java b/web/src/test/java/org/springframework/security/web/access/TestWebInvocationPrivilegeEvaluators.java similarity index 94% rename from web/src/test/java/org/springframework/security/web/access/TestWebInvocationPrivilegeEvaluator.java rename to web/src/test/java/org/springframework/security/web/access/TestWebInvocationPrivilegeEvaluators.java index 54ab666cd52..9ee7278a1c1 100644 --- a/web/src/test/java/org/springframework/security/web/access/TestWebInvocationPrivilegeEvaluator.java +++ b/web/src/test/java/org/springframework/security/web/access/TestWebInvocationPrivilegeEvaluators.java @@ -18,13 +18,13 @@ import org.springframework.security.core.Authentication; -public final class TestWebInvocationPrivilegeEvaluator { +public final class TestWebInvocationPrivilegeEvaluators { private static final AlwaysAllowWebInvocationPrivilegeEvaluator ALWAYS_ALLOW = new AlwaysAllowWebInvocationPrivilegeEvaluator(); private static final AlwaysDenyWebInvocationPrivilegeEvaluator ALWAYS_DENY = new AlwaysDenyWebInvocationPrivilegeEvaluator(); - private TestWebInvocationPrivilegeEvaluator() { + private TestWebInvocationPrivilegeEvaluators() { } public static WebInvocationPrivilegeEvaluator alwaysAllow() {