Skip to content

Commit 05213c6

Browse files
committed
Give meaningful names to SprXxxTests in spring-test
1 parent 9bda734 commit 05213c6

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

spring-test/src/test/java/org/springframework/test/web/servlet/Spr11441Tests.java renamed to spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/EncodedUriTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.test.web.servlet;
17+
package org.springframework.test.web.servlet.samples.spr;
1818

1919

2020
import org.junit.Before;
@@ -31,6 +31,8 @@
3131
import org.springframework.test.context.ContextConfiguration;
3232
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
3333
import org.springframework.test.context.web.WebAppConfiguration;
34+
import org.springframework.test.web.servlet.MockMvc;
35+
import org.springframework.test.web.servlet.ResultActions;
3436
import org.springframework.ui.Model;
3537
import org.springframework.web.bind.annotation.PathVariable;
3638
import org.springframework.web.bind.annotation.RequestMapping;
@@ -51,14 +53,14 @@
5153
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup;
5254

5355
/**
54-
* Tests for SPR-11441 (MockMvc needs to accept prepared URI with encoded URI path variables).
56+
* Tests for SPR-11441 (MockMvc accepts an already encoded URI).
5557
*
5658
* @author Sebastien Deleuze
5759
*/
5860
@RunWith(SpringJUnit4ClassRunner.class)
5961
@WebAppConfiguration
6062
@ContextConfiguration
61-
public class Spr11441Tests {
63+
public class EncodedUriTests {
6264

6365
@Autowired
6466
private WebApplicationContext wac;

spring-test/src/test/java/org/springframework/test/web/servlet/Spr10093Tests.java renamed to spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/HttpOptionsTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.test.web.servlet;
17+
package org.springframework.test.web.servlet.samples.spr;
1818

1919
import java.util.concurrent.atomic.AtomicInteger;
2020

@@ -29,6 +29,7 @@
2929
import org.springframework.test.context.ContextConfiguration;
3030
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
3131
import org.springframework.test.context.web.WebAppConfiguration;
32+
import org.springframework.test.web.servlet.MockMvc;
3233
import org.springframework.web.bind.annotation.RequestMapping;
3334
import org.springframework.web.bind.annotation.RequestMethod;
3435
import org.springframework.web.bind.annotation.ResponseBody;
@@ -49,7 +50,7 @@
4950
@RunWith(SpringJUnit4ClassRunner.class)
5051
@WebAppConfiguration
5152
@ContextConfiguration
52-
public class Spr10093Tests {
53+
public class HttpOptionsTests {
5354

5455
@Autowired
5556
private WebApplicationContext wac;

spring-test/src/test/java/org/springframework/test/web/servlet/setup/Spr10277Tests.java renamed to spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/MockMvcBuilderMethodChainTests.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
package org.springframework.test.web.servlet.setup;
1+
/*
2+
* Copyright 2002-2014 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.test.web.servlet.samples.spr;
217

318
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
419

@@ -9,20 +24,21 @@
924
import org.springframework.test.context.ContextConfiguration;
1025
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
1126
import org.springframework.test.context.web.WebAppConfiguration;
27+
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
1228
import org.springframework.web.context.WebApplicationContext;
1329
import org.springframework.web.filter.CharacterEncodingFilter;
1430
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
1531
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
1632

1733
/**
18-
* Test for SPR-10277 (Multiple method chaining when building MockMvc).
34+
* Test for SPR-10277 (multiple method chaining when building MockMvc).
1935
*
2036
* @author Wesley Hall
2137
*/
2238
@RunWith(SpringJUnit4ClassRunner.class)
2339
@WebAppConfiguration
2440
@ContextConfiguration
25-
public class Spr10277Tests {
41+
public class MockMvcBuilderMethodChainTests {
2642

2743
@Autowired
2844
private WebApplicationContext wac;

spring-test/src/test/java/org/springframework/test/web/servlet/Spr10025Tests.java renamed to spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.test.web.servlet;
17+
package org.springframework.test.web.servlet.samples.spr;
1818

1919
import org.junit.Before;
2020
import org.junit.Test;
@@ -28,6 +28,7 @@
2828
import org.springframework.test.context.ContextConfiguration;
2929
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
3030
import org.springframework.test.context.web.WebAppConfiguration;
31+
import org.springframework.test.web.servlet.MockMvc;
3132
import org.springframework.web.bind.annotation.RequestMapping;
3233
import org.springframework.web.bind.annotation.ResponseBody;
3334
import org.springframework.web.context.WebApplicationContext;
@@ -42,14 +43,14 @@
4243
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*;
4344

4445
/**
45-
* Test for SPR-10025.
46+
* Test for SPR-10025 (access to request attributes via RequestContextHolder).
4647
*
4748
* @author Rossen Stoyanchev
4849
*/
4950
@RunWith(SpringJUnit4ClassRunner.class)
5051
@WebAppConfiguration
5152
@ContextConfiguration
52-
public class Spr10025Tests {
53+
public class RequestContextHolderTests {
5354

5455
@Autowired
5556
private WebApplicationContext wac;

0 commit comments

Comments
 (0)