Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a96dcf5

Browse files
Chu3laManjzheaux
authored andcommittedApr 3, 2025··
Update WebAuthn Test Objects Class Names
Closes gh-16604 Signed-off-by: chu3la <elmansouri.houssam@gmail.com>
1 parent 4cdc6da commit a96dcf5

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed
 

Diff for: ‎config/src/test/java/org/springframework/security/config/annotation/web/builders/TestHttpSecurity.java renamed to ‎config/src/test/java/org/springframework/security/config/annotation/web/builders/TestHttpSecurities.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import org.springframework.security.config.annotation.web.configurers.DefaultLoginPageConfigurer;
2222
import org.springframework.test.util.ReflectionTestUtils;
2323

24-
public final class TestHttpSecurity {
24+
public final class TestHttpSecurities {
2525

26-
private TestHttpSecurity() {
26+
private TestHttpSecurities() {
2727

2828
}
2929

Diff for: ‎config/src/test/java/org/springframework/security/config/annotation/web/configurers/DefaultFiltersTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import org.springframework.mock.web.MockHttpServletRequest;
3232
import org.springframework.mock.web.MockHttpServletResponse;
3333
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
34-
import org.springframework.security.config.annotation.web.builders.TestHttpSecurity;
34+
import org.springframework.security.config.annotation.web.builders.TestHttpSecurities;
3535
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
3636
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
3737
import org.springframework.security.config.test.SpringTestContext;
@@ -169,7 +169,7 @@ static class NullWebInvocationPrivilegeEvaluatorConfig {
169169

170170
@Bean
171171
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
172-
TestHttpSecurity.disableDefaults(http);
172+
TestHttpSecurities.disableDefaults(http);
173173
http.formLogin();
174174
return http.build();
175175
}

Diff for: ‎config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.springframework.context.annotation.Configuration;
3333
import org.springframework.security.authentication.AuthenticationManager;
3434
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
35-
import org.springframework.security.config.annotation.web.builders.TestHttpSecurity;
35+
import org.springframework.security.config.annotation.web.builders.TestHttpSecurities;
3636
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
3737
import org.springframework.security.config.test.SpringTestContext;
3838
import org.springframework.security.config.test.SpringTestContextExtension;
@@ -140,7 +140,7 @@ static class CustomFilterPositionConfig {
140140
@Bean
141141
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
142142
// @formatter:off
143-
TestHttpSecurity.disableDefaults(http);
143+
TestHttpSecurities.disableDefaults(http);
144144
http
145145
// this works so long as the CustomFilter extends one of the standard filters
146146
// if not, use addFilterBefore or addFilterAfter
@@ -158,7 +158,7 @@ static class CustomFilterPositionAtConfig {
158158
@Bean
159159
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
160160
// @formatter:off
161-
TestHttpSecurity.disableDefaults(http);
161+
TestHttpSecurities.disableDefaults(http);
162162
http
163163
.addFilterAt(new OtherCustomFilter(), UsernamePasswordAuthenticationFilter.class);
164164
return http.build();
@@ -179,7 +179,7 @@ AuthenticationManager authenticationManager() {
179179
@Bean
180180
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
181181
// @formatter:off
182-
TestHttpSecurity.disableDefaults(http);
182+
TestHttpSecurities.disableDefaults(http);
183183
http
184184
.authorizeRequests()
185185
.anyRequest().hasRole("USER")

Diff for: ‎config/src/test/java/org/springframework/security/config/annotation/web/configurers/SecurityContextConfigurerTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import org.springframework.security.config.ObjectPostProcessor;
3232
import org.springframework.security.config.TestDeferredSecurityContext;
3333
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
34-
import org.springframework.security.config.annotation.web.builders.TestHttpSecurity;
34+
import org.springframework.security.config.annotation.web.builders.TestHttpSecurities;
3535
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
3636
import org.springframework.security.config.test.SpringTestContext;
3737
import org.springframework.security.config.test.SpringTestContextExtension;
@@ -199,7 +199,7 @@ static class SecurityContextRepositoryDefaultsSecurityContextRepositoryConfig {
199199

200200
@Bean
201201
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
202-
TestHttpSecurity.disableDefaults(http);
202+
TestHttpSecurities.disableDefaults(http);
203203
// @formatter:off
204204
http
205205
.addFilter(new WebAsyncManagerIntegrationFilter())

Diff for: ‎web/src/test/java/org/springframework/security/web/access/RequestMatcherDelegatingWebInvocationPrivilegeEvaluatorTests.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void isAllowedWhenDelegatesEmptyThenAllowed() {
7575
@Test
7676
void isAllowedWhenNotMatchThenAllowed() {
7777
RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> notMatch = entry(this.alwaysDeny,
78-
TestWebInvocationPrivilegeEvaluator.alwaysAllow());
78+
TestWebInvocationPrivilegeEvaluators.alwaysAllow());
7979
WebInvocationPrivilegeEvaluator delegating = evaluator(notMatch);
8080
assertThat(delegating.isAllowed(this.uri, this.authentication)).isTrue();
8181
verify(notMatch.getRequestMatcher()).matches(any());
@@ -96,9 +96,9 @@ void isAllowedWhenPrivilegeEvaluatorDenyThenAllowedFalse() {
9696
@Test
9797
void isAllowedWhenNotMatchThenMatchThenOnlySecondDelegateInvoked() {
9898
RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> notMatchDelegate = entry(this.alwaysDeny,
99-
TestWebInvocationPrivilegeEvaluator.alwaysAllow());
99+
TestWebInvocationPrivilegeEvaluators.alwaysAllow());
100100
RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> matchDelegate = entry(this.alwaysMatch,
101-
TestWebInvocationPrivilegeEvaluator.alwaysAllow());
101+
TestWebInvocationPrivilegeEvaluators.alwaysAllow());
102102
RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> spyNotMatchDelegate = spy(notMatchDelegate);
103103
RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> spyMatchDelegate = spy(matchDelegate);
104104

@@ -120,8 +120,8 @@ void isAllowedWhenDelegatePrivilegeEvaluatorsEmptyThenAllowedTrue() {
120120

121121
@Test
122122
void isAllowedWhenFirstDelegateDenyThenDoNotInvokeOthers() {
123-
WebInvocationPrivilegeEvaluator deny = TestWebInvocationPrivilegeEvaluator.alwaysDeny();
124-
WebInvocationPrivilegeEvaluator allow = TestWebInvocationPrivilegeEvaluator.alwaysAllow();
123+
WebInvocationPrivilegeEvaluator deny = TestWebInvocationPrivilegeEvaluators.alwaysDeny();
124+
WebInvocationPrivilegeEvaluator allow = TestWebInvocationPrivilegeEvaluators.alwaysAllow();
125125
WebInvocationPrivilegeEvaluator spyDeny = spy(deny);
126126
WebInvocationPrivilegeEvaluator spyAllow = spy(allow);
127127
RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> delegate = entry(this.alwaysMatch, spyDeny,
@@ -136,7 +136,7 @@ void isAllowedWhenFirstDelegateDenyThenDoNotInvokeOthers() {
136136

137137
@Test
138138
void isAllowedWhenDifferentArgumentsThenCallSpecificIsAllowedInDelegate() {
139-
WebInvocationPrivilegeEvaluator deny = TestWebInvocationPrivilegeEvaluator.alwaysDeny();
139+
WebInvocationPrivilegeEvaluator deny = TestWebInvocationPrivilegeEvaluators.alwaysDeny();
140140
WebInvocationPrivilegeEvaluator spyDeny = spy(deny);
141141
RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> delegate = entry(this.alwaysMatch, spyDeny);
142142

@@ -197,11 +197,11 @@ private RequestMatcherDelegatingWebInvocationPrivilegeEvaluator evaluator(Reques
197197
}
198198

199199
private RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> allow(RequestMatcher requestMatcher) {
200-
return entry(requestMatcher, TestWebInvocationPrivilegeEvaluator.alwaysAllow());
200+
return entry(requestMatcher, TestWebInvocationPrivilegeEvaluators.alwaysAllow());
201201
}
202202

203203
private RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> deny(RequestMatcher requestMatcher) {
204-
return entry(requestMatcher, TestWebInvocationPrivilegeEvaluator.alwaysDeny());
204+
return entry(requestMatcher, TestWebInvocationPrivilegeEvaluators.alwaysDeny());
205205
}
206206

207207
private RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> entry(RequestMatcher requestMatcher,

Diff for: ‎web/src/test/java/org/springframework/security/web/access/TestWebInvocationPrivilegeEvaluator.java renamed to ‎web/src/test/java/org/springframework/security/web/access/TestWebInvocationPrivilegeEvaluators.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818

1919
import org.springframework.security.core.Authentication;
2020

21-
public final class TestWebInvocationPrivilegeEvaluator {
21+
public final class TestWebInvocationPrivilegeEvaluators {
2222

2323
private static final AlwaysAllowWebInvocationPrivilegeEvaluator ALWAYS_ALLOW = new AlwaysAllowWebInvocationPrivilegeEvaluator();
2424

2525
private static final AlwaysDenyWebInvocationPrivilegeEvaluator ALWAYS_DENY = new AlwaysDenyWebInvocationPrivilegeEvaluator();
2626

27-
private TestWebInvocationPrivilegeEvaluator() {
27+
private TestWebInvocationPrivilegeEvaluators() {
2828
}
2929

3030
public static WebInvocationPrivilegeEvaluator alwaysAllow() {

0 commit comments

Comments
 (0)
Please sign in to comment.