diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/Spr11441Tests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/EncodedUriTests.java similarity index 94% rename from spring-test/src/test/java/org/springframework/test/web/servlet/Spr11441Tests.java rename to spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/EncodedUriTests.java index f9d674f1a0..b1fa6931ff 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/Spr11441Tests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/EncodedUriTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.test.web.servlet; +package org.springframework.test.web.servlet.samples.spr; import org.junit.Before; @@ -31,6 +31,8 @@ import org.springframework.stereotype.Controller; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.ResultActions; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -51,14 +53,14 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup; /** - * Tests for SPR-11441 (MockMvc needs to accept prepared URI with encoded URI path variables). + * Tests for SPR-11441 (MockMvc accepts an already encoded URI). * * @author Sebastien Deleuze */ @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextConfiguration -public class Spr11441Tests { +public class EncodedUriTests { @Autowired private WebApplicationContext wac; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/Spr10093Tests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/HttpOptionsTests.java similarity index 95% rename from spring-test/src/test/java/org/springframework/test/web/servlet/Spr10093Tests.java rename to spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/HttpOptionsTests.java index 1f4d919e09..1aae207e7e 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/Spr10093Tests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/HttpOptionsTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.test.web.servlet; +package org.springframework.test.web.servlet.samples.spr; import java.util.concurrent.atomic.AtomicInteger; @@ -29,6 +29,7 @@ import org.springframework.stereotype.Controller; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; +import org.springframework.test.web.servlet.MockMvc; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @@ -49,7 +50,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*; @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextConfiguration -public class Spr10093Tests { +public class HttpOptionsTests { @Autowired private WebApplicationContext wac; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/Spr10277Tests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/MockMvcBuilderMethodChainTests.java similarity index 60% rename from spring-test/src/test/java/org/springframework/test/web/servlet/setup/Spr10277Tests.java rename to spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/MockMvcBuilderMethodChainTests.java index 101285c520..d8eb8ff3ff 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/Spr10277Tests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/MockMvcBuilderMethodChainTests.java @@ -1,4 +1,19 @@ -package org.springframework.test.web.servlet.setup; +/* + * Copyright 2002-2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.test.web.servlet.samples.spr; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -9,20 +24,21 @@ import org.springframework.context.annotation.Configuration; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.filter.CharacterEncodingFilter; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** - * Test for SPR-10277 (Multiple method chaining when building MockMvc). + * Test for SPR-10277 (multiple method chaining when building MockMvc). * * @author Wesley Hall */ @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextConfiguration -public class Spr10277Tests { +public class MockMvcBuilderMethodChainTests { @Autowired private WebApplicationContext wac; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/Spr10025Tests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java similarity index 92% rename from spring-test/src/test/java/org/springframework/test/web/servlet/Spr10025Tests.java rename to spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java index c715e6b180..4d3f236e83 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/Spr10025Tests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.test.web.servlet; +package org.springframework.test.web.servlet.samples.spr; import org.junit.Before; import org.junit.Test; @@ -28,6 +28,7 @@ import org.springframework.stereotype.Controller; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; +import org.springframework.test.web.servlet.MockMvc; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.context.WebApplicationContext; @@ -42,14 +43,14 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*; /** - * Test for SPR-10025. + * Test for SPR-10025 (access to request attributes via RequestContextHolder). * * @author Rossen Stoyanchev */ @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextConfiguration -public class Spr10025Tests { +public class RequestContextHolderTests { @Autowired private WebApplicationContext wac;