Skip to content

Commit 443af32

Browse files
committed
Move Servlet Mocks to Web
Issue gh-13551
1 parent 8827b2e commit 443af32

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

config/src/test/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistryTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
import org.springframework.core.ResolvableType;
3232
import org.springframework.http.HttpMethod;
3333
import org.springframework.mock.web.MockHttpServletRequest;
34-
import org.springframework.security.config.MockServletContext;
3534
import org.springframework.security.config.ObjectPostProcessor;
36-
import org.springframework.security.config.TestMockHttpServletMappings;
3735
import org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry.DispatcherServletDelegatingRequestMatcher;
3836
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
3937
import org.springframework.security.config.test.SpringTestContext;
38+
import org.springframework.security.web.servlet.MockServletContext;
39+
import org.springframework.security.web.servlet.TestMockHttpServletMappings;
4040
import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher;
4141
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
4242
import org.springframework.security.web.util.matcher.DispatcherTypeRequestMatcher;

config/src/test/java/org/springframework/security/config/annotation/web/configurers/AuthorizeRequestsTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.springframework.security.access.hierarchicalroles.RoleHierarchy;
3232
import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl;
3333
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
34-
import org.springframework.security.config.MockServletContext;
3534
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
3635
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
3736
import org.springframework.security.core.authority.AuthorityUtils;
@@ -42,6 +41,7 @@
4241
import org.springframework.security.web.FilterChainProxy;
4342
import org.springframework.security.web.SecurityFilterChain;
4443
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
44+
import org.springframework.security.web.servlet.MockServletContext;
4545
import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher;
4646
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
4747
import org.springframework.web.bind.annotation.RequestMapping;

config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpSecuritySecurityMatchersTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.springframework.mock.web.MockFilterChain;
3333
import org.springframework.mock.web.MockHttpServletRequest;
3434
import org.springframework.mock.web.MockHttpServletResponse;
35-
import org.springframework.security.config.MockServletContext;
3635
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
3736
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
3837
import org.springframework.security.core.userdetails.User;
@@ -42,6 +41,7 @@
4241
import org.springframework.security.web.DefaultSecurityFilterChain;
4342
import org.springframework.security.web.FilterChainProxy;
4443
import org.springframework.security.web.SecurityFilterChain;
44+
import org.springframework.security.web.servlet.MockServletContext;
4545
import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher;
4646
import org.springframework.security.web.util.matcher.RequestMatcher;
4747
import org.springframework.test.util.ReflectionTestUtils;

config/src/test/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurerTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.springframework.mock.web.MockHttpServletRequest;
3232
import org.springframework.mock.web.MockHttpServletResponse;
3333
import org.springframework.security.config.Customizer;
34-
import org.springframework.security.config.MockServletContext;
3534
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
3635
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
3736
import org.springframework.security.core.userdetails.PasswordEncodedUser;
@@ -41,6 +40,7 @@
4140
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
4241
import org.springframework.security.web.FilterChainProxy;
4342
import org.springframework.security.web.SecurityFilterChain;
43+
import org.springframework.security.web.servlet.MockServletContext;
4444
import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher;
4545
import org.springframework.web.bind.annotation.RequestMapping;
4646
import org.springframework.web.bind.annotation.RestController;

config/src/test/java/org/springframework/security/config/test/SpringTestContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
3030
import org.springframework.mock.web.MockServletConfig;
3131
import org.springframework.security.config.BeanIds;
32-
import org.springframework.security.config.MockServletContext;
3332
import org.springframework.security.config.util.InMemoryXmlWebApplicationContext;
33+
import org.springframework.security.web.servlet.MockServletContext;
3434
import org.springframework.test.context.web.GenericXmlWebContextLoader;
3535
import org.springframework.test.web.servlet.MockMvc;
3636
import org.springframework.test.web.servlet.request.RequestPostProcessor;

config/src/test/java/org/springframework/security/config/MockServletContext.java renamed to web/src/test/java/org/springframework/security/web/servlet/MockServletContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.security.config;
17+
package org.springframework.security.web.servlet;
1818

1919
import java.util.Arrays;
2020
import java.util.Collection;

config/src/test/java/org/springframework/security/config/TestMockHttpServletMappings.java renamed to web/src/test/java/org/springframework/security/web/servlet/TestMockHttpServletMappings.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.security.config;
17+
package org.springframework.security.web.servlet;
1818

1919
import jakarta.servlet.http.HttpServletRequest;
2020
import jakarta.servlet.http.MappingMatch;

0 commit comments

Comments
 (0)