mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-20 20:59:07 +00:00
Enable SpringJUnit5 Checkstyle rule
See gh-36496 Closes gh-36496
This commit is contained in:
Vendored
+1
-1
@@ -52,5 +52,5 @@ import org.junit.platform.suite.api.Suite;
|
||||
key = ClassOrderer.DEFAULT_ORDER_PROPERTY_NAME,
|
||||
value = "org.junit.jupiter.api.ClassOrderer$ClassName"
|
||||
)
|
||||
public class ContextCacheTestSuite {
|
||||
class ContextCacheTestSuite {
|
||||
}
|
||||
|
||||
+1
-1
@@ -50,5 +50,5 @@ import org.junit.platform.suite.api.Suite;
|
||||
key = ClassOrderer.DEFAULT_ORDER_PROPERTY_NAME,
|
||||
value = "org.junit.jupiter.api.ClassOrderer$ClassName"
|
||||
)
|
||||
public class ContextConfigTestSuite {
|
||||
class ContextConfigTestSuite {
|
||||
}
|
||||
|
||||
+2
-2
@@ -45,13 +45,13 @@ import static org.springframework.test.context.TestExecutionListeners.MergeMode.
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@TestExecutionListeners(listeners = CustomEventPublishingTestExecutionListener.class, mergeMode = MERGE_WITH_DEFAULTS)
|
||||
public class CustomTestEventTests {
|
||||
class CustomTestEventTests {
|
||||
|
||||
private static final List<CustomEvent> events = new ArrayList<>();
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void clearEvents() {
|
||||
void clearEvents() {
|
||||
events.clear();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ import static org.mockito.Mockito.verify;
|
||||
* @author Sam Brannen
|
||||
* @since 5.2
|
||||
*/
|
||||
public class EventPublishingTestExecutionListenerIntegrationTests {
|
||||
class EventPublishingTestExecutionListenerIntegrationTests {
|
||||
|
||||
private static final String THREAD_NAME_PREFIX = "Test-";
|
||||
|
||||
@@ -88,7 +88,7 @@ public class EventPublishingTestExecutionListenerIntegrationTests {
|
||||
|
||||
|
||||
@AfterEach
|
||||
public void closeApplicationContext() {
|
||||
void closeApplicationContext() {
|
||||
this.testContext.markApplicationContextDirty(null);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@ContextHierarchy(@ContextConfiguration)
|
||||
@DisabledInAotMode("@ContextHierarchy is not supported in AOT")
|
||||
public class DispatcherWacRootWacEarTests extends RootWacEarTests {
|
||||
class DispatcherWacRootWacEarTests extends RootWacEarTests {
|
||||
|
||||
@Autowired
|
||||
private WebApplicationContext wac;
|
||||
|
||||
+1
-1
@@ -58,5 +58,5 @@ import org.springframework.context.ApplicationContextInitializer;
|
||||
key = ClassOrderer.DEFAULT_ORDER_PROPERTY_NAME,
|
||||
value = "org.junit.jupiter.api.ClassOrderer$ClassName"
|
||||
)
|
||||
public class AciTestSuite {
|
||||
class AciTestSuite {
|
||||
}
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@ComposedContextConfiguration(BarConfig.class)
|
||||
public class InitializerConfiguredViaMetaAnnotationTests {
|
||||
class InitializerConfiguredViaMetaAnnotationTests {
|
||||
|
||||
@Autowired
|
||||
String foo;
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @since 3.2
|
||||
*/
|
||||
@SpringJUnitConfig(initializers = EntireAppInitializer.class)
|
||||
public class InitializerWithoutConfigFilesOrClassesTests {
|
||||
class InitializerWithoutConfigFilesOrClassesTests {
|
||||
|
||||
@Autowired
|
||||
private String foo;
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @since 3.2
|
||||
*/
|
||||
@SpringJUnitConfig(initializers = DevProfileInitializer.class)
|
||||
public class MergedInitializersAnnotationConfigTests extends SingleInitializerAnnotationConfigTests {
|
||||
class MergedInitializersAnnotationConfigTests extends SingleInitializerAnnotationConfigTests {
|
||||
|
||||
@Override
|
||||
@Test
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@SpringJUnitConfig(classes = { GlobalConfig.class, DevProfileConfig.class }, initializers = {
|
||||
FooBarAliasInitializer.class, DevProfileInitializer.class })
|
||||
public class MultipleInitializersAnnotationConfigTests {
|
||||
class MultipleInitializersAnnotationConfigTests {
|
||||
|
||||
@Autowired
|
||||
private String foo, bar, baz;
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
// Note: the ordering of the initializers is intentionally: two, one.
|
||||
@SpringJUnitConfig(classes = { GlobalConfig.class, ConfigTwo.class, ConfigOne.class }, initializers = {
|
||||
OrderedTwoInitializer.class, OrderedOneInitializer.class })
|
||||
public class OrderedInitializersAnnotationConfigTests {
|
||||
class OrderedInitializersAnnotationConfigTests {
|
||||
|
||||
private static final String PROFILE_GLOBAL = "global";
|
||||
private static final String PROFILE_ONE = "one";
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @since 3.2
|
||||
*/
|
||||
@SpringJUnitConfig(initializers = DevProfileInitializer.class, inheritInitializers = false)
|
||||
public class OverriddenInitializersAnnotationConfigTests extends SingleInitializerAnnotationConfigTests {
|
||||
class OverriddenInitializersAnnotationConfigTests extends SingleInitializerAnnotationConfigTests {
|
||||
|
||||
@Test
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @since 4.1
|
||||
*/
|
||||
@SpringJUnitConfig(initializers = PropertySourcesInitializerTests.PropertySourceInitializer.class)
|
||||
public class PropertySourcesInitializerTests {
|
||||
class PropertySourcesInitializerTests {
|
||||
|
||||
@Configuration
|
||||
static class Config {
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @since 3.2
|
||||
*/
|
||||
@SpringJUnitConfig(classes = { GlobalConfig.class, DevProfileConfig.class }, initializers = FooBarAliasInitializer.class)
|
||||
public class SingleInitializerAnnotationConfigTests {
|
||||
class SingleInitializerAnnotationConfigTests {
|
||||
|
||||
@Autowired
|
||||
protected String foo;
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @since 3.2
|
||||
*/
|
||||
@SpringJUnitConfig(initializers = { FooBarAliasInitializer.class, DevProfileInitializer.class })
|
||||
public class MultipleInitializersXmlConfigTests {
|
||||
class MultipleInitializersXmlConfigTests {
|
||||
|
||||
@Autowired
|
||||
private String foo, bar, baz;
|
||||
|
||||
+1
-1
@@ -46,5 +46,5 @@ import org.junit.platform.suite.api.Suite;
|
||||
@SelectPackages("org.springframework.test.context.junit.jupiter")
|
||||
@IncludeClassNamePatterns(".*Tests$")
|
||||
@ExcludeTags("failing-test-case")
|
||||
public class SpringJUnitJupiterTestSuite {
|
||||
class SpringJUnitJupiterTestSuite {
|
||||
}
|
||||
|
||||
+2
-1
@@ -24,11 +24,12 @@ import org.springframework.test.context.ActiveProfilesResolver;
|
||||
* @since 4.0
|
||||
*/
|
||||
@ActiveProfiles(resolver = DevProfileResolverAnnotationConfigTests.class, inheritProfiles = false)
|
||||
public class DevProfileResolverAnnotationConfigTests extends DevProfileAnnotationConfigTests implements
|
||||
class DevProfileResolverAnnotationConfigTests extends DevProfileAnnotationConfigTests implements
|
||||
ActiveProfilesResolver {
|
||||
|
||||
@Override
|
||||
public String[] resolve(Class<?> testClass) {
|
||||
return new String[] { "dev" };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThatNoException;
|
||||
* @author Sam Brannen
|
||||
* @since 5.3.10
|
||||
*/
|
||||
public class ExceptionCollectorTests {
|
||||
class ExceptionCollectorTests {
|
||||
|
||||
private static final char EOL = '\n';
|
||||
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import static org.hamcrest.Matchers.hasXPath;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ContentRequestMatchersTests {
|
||||
class ContentRequestMatchersTests {
|
||||
|
||||
private final MockClientHttpRequest request = new MockClientHttpRequest();
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
public class JsonPathRequestMatchersTests {
|
||||
class JsonPathRequestMatchersTests {
|
||||
|
||||
private static final String REQUEST_CONTENT = "{" + //
|
||||
"'str': 'foo', " + //
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
* @author Valentin Spac
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class MultipartRequestMatchersTests {
|
||||
class MultipartRequestMatchersTests {
|
||||
|
||||
private final MockClientHttpRequest request = new MockClientHttpRequest();
|
||||
|
||||
@@ -54,7 +54,7 @@ public class MultipartRequestMatchersTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.request.getHeaders().setContentType(MediaType.MULTIPART_FORM_DATA);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class XpathRequestMatchersTests {
|
||||
class XpathRequestMatchersTests {
|
||||
|
||||
private static final String RESPONSE_CONTENT = "<foo><bar>111</bar><bar>true</bar></foo>";
|
||||
|
||||
@@ -39,7 +39,7 @@ public class XpathRequestMatchersTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws IOException {
|
||||
void setUp() throws IOException {
|
||||
this.request = new MockClientHttpRequest();
|
||||
this.request.getBody().write(RESPONSE_CONTENT.getBytes());
|
||||
}
|
||||
|
||||
+2
-2
@@ -53,7 +53,7 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
|
||||
* @see ContentRequestMatchersIntegrationTests
|
||||
* @see XmlContentRequestMatchersIntegrationTests
|
||||
*/
|
||||
public class XpathRequestMatchersIntegrationTests {
|
||||
class XpathRequestMatchersIntegrationTests {
|
||||
|
||||
private static final Map<String, String> NS =
|
||||
Collections.singletonMap("ns", "https://example.org/music/people");
|
||||
@@ -67,7 +67,7 @@ public class XpathRequestMatchersIntegrationTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
List<Person> composers = Arrays.asList(
|
||||
new Person("Johann Sebastian Bach").setSomeDouble(21),
|
||||
new Person("Johannes Brahms").setSomeDouble(.0025),
|
||||
|
||||
+1
-2
@@ -34,8 +34,7 @@ import org.springframework.web.server.session.WebSessionManager;
|
||||
* Unit tests with {@link ApplicationContextSpec}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ApplicationContextSpecTests {
|
||||
|
||||
class ApplicationContextSpecTests {
|
||||
|
||||
@Test // SPR-17094
|
||||
void sessionManagerBean() {
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class DefaultControllerSpecTests {
|
||||
class DefaultControllerSpecTests {
|
||||
|
||||
@Test
|
||||
void controller() {
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class DefaultRouterFunctionSpecTests {
|
||||
class DefaultRouterFunctionSpecTests {
|
||||
|
||||
@Test
|
||||
void webFilter() {
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class HttpHandlerConnectorTests {
|
||||
class HttpHandlerConnectorTests {
|
||||
|
||||
@Test
|
||||
void adaptRequest() {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Tests for {@link AbstractMockServerSpec}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class MockServerSpecTests {
|
||||
class MockServerSpecTests {
|
||||
|
||||
private final TestMockServerSpec serverSpec = new TestMockServerSpec();
|
||||
|
||||
|
||||
+1
-2
@@ -37,8 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Test scenarios involving a mock server.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class MockServerTests {
|
||||
|
||||
class MockServerTests {
|
||||
|
||||
@Test // SPR-15674 (in comments)
|
||||
void mutateDoesNotCreateNewSession() {
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 5.0
|
||||
*/
|
||||
public class WiretapConnectorTests {
|
||||
class WiretapConnectorTests {
|
||||
|
||||
private final LeakAwareDataBufferFactory bufferFactory =
|
||||
new LeakAwareDataBufferFactory(new NettyDataBufferFactory(PooledByteBufAllocator.DEFAULT));
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class WebTestClientResponseTests {
|
||||
class WebTestClientResponseTests {
|
||||
|
||||
private final WebTestClient client = WebTestClient.bindToController(HelloController.class).build();
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ApiVersionTests {
|
||||
class ApiVersionTests {
|
||||
|
||||
@Test
|
||||
void header() {
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class GlobalEntityResultConsumerTests {
|
||||
class GlobalEntityResultConsumerTests {
|
||||
|
||||
private final StringBuilder output = new StringBuilder();
|
||||
|
||||
|
||||
+2
-2
@@ -29,13 +29,13 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ControllerTests {
|
||||
class ControllerTests {
|
||||
|
||||
private WebTestClient client;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
void setUp() throws Exception {
|
||||
this.client = WebTestClient.bindToController(new TestController()).build();
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -35,7 +35,7 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 5.0
|
||||
*/
|
||||
public class HttpServerTests {
|
||||
class HttpServerTests {
|
||||
|
||||
private ReactorHttpServer server;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class HttpServerTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void start() throws Exception {
|
||||
void start() throws Exception {
|
||||
HttpHandler httpHandler = RouterFunctions.toHttpHandler(
|
||||
route(GET("/test"), request -> ServerResponse.ok().bodyValue("It works!")));
|
||||
|
||||
@@ -58,7 +58,7 @@ public class HttpServerTests {
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void stop() {
|
||||
void stop() {
|
||||
this.server.stop();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -32,13 +32,13 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 5.0
|
||||
*/
|
||||
public class RouterFunctionTests {
|
||||
class RouterFunctionTests {
|
||||
|
||||
private WebTestClient testClient;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
void setUp() throws Exception {
|
||||
|
||||
RouterFunction<?> route = route(GET("/test"), request ->
|
||||
ServerResponse.ok().bodyValue("It works!"));
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class DefaultMvcResultTests {
|
||||
class DefaultMvcResultTests {
|
||||
|
||||
private final DefaultMvcResult mvcResult = new DefaultMvcResult(new MockHttpServletRequest(), null);
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public class AbstractHttpServletRequestAssertTests {
|
||||
class AbstractHttpServletRequestAssertTests {
|
||||
|
||||
@Nested
|
||||
class AttributesTests {
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public class AbstractMockHttpServletResponseAssertTests {
|
||||
class AbstractMockHttpServletResponseAssertTests {
|
||||
|
||||
@Test
|
||||
void bodyText() {
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ import static org.mockito.Mockito.verifyNoInteractions;
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@SpringJUnitWebConfig
|
||||
public class MockMvcTesterIntegrationTests {
|
||||
class MockMvcTesterIntegrationTests {
|
||||
|
||||
private static final MockMultipartFile file = new MockMultipartFile("file", "content.txt", null,
|
||||
"value".getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class RestTestClientResponseTests {
|
||||
class RestTestClientResponseTests {
|
||||
|
||||
private final RestTestClient client =
|
||||
RestTestClient.bindToController(HelloController.class)
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ApiVersionTests {
|
||||
class ApiVersionTests {
|
||||
|
||||
@Test
|
||||
void header() {
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
|
||||
* @author Sam Brannen
|
||||
* @since 4.2
|
||||
*/
|
||||
public class HostRequestMatcherTests extends AbstractWebRequestMatcherTests {
|
||||
class HostRequestMatcherTests extends AbstractWebRequestMatcherTests {
|
||||
|
||||
@Test
|
||||
void localhost() throws Exception {
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
* @author Sam Brannen
|
||||
* @since 4.2
|
||||
*/
|
||||
public class HtmlUnitRequestBuilderTests {
|
||||
class HtmlUnitRequestBuilderTests {
|
||||
|
||||
private final WebClient webClient = new WebClient();
|
||||
|
||||
|
||||
+2
-2
@@ -51,7 +51,7 @@ import static org.mockito.Mockito.mock;
|
||||
*/
|
||||
@SpringJUnitWebConfig
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class MockMvcConnectionBuilderSupportTests {
|
||||
class MockMvcConnectionBuilderSupportTests {
|
||||
|
||||
private final WebClient client = mock();
|
||||
|
||||
@@ -62,7 +62,7 @@ public class MockMvcConnectionBuilderSupportTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
given(this.client.getWebConnection()).willReturn(mock());
|
||||
this.builder = new MockMvcWebConnectionBuilderSupport(this.wac) {};
|
||||
}
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
* @author Rob Winch
|
||||
* @since 4.2
|
||||
*/
|
||||
public class MockMvcWebConnectionTests {
|
||||
class MockMvcWebConnectionTests {
|
||||
|
||||
private final WebClient webClient = new WebClient();
|
||||
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
|
||||
* @author Rob Winch
|
||||
* @since 4.2
|
||||
*/
|
||||
public class MockWebResponseBuilderTests {
|
||||
class MockWebResponseBuilderTests {
|
||||
|
||||
private final MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
|
||||
@@ -48,7 +48,7 @@ public class MockWebResponseBuilderTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() throws Exception {
|
||||
void setup() throws Exception {
|
||||
this.webRequest = new WebRequest(new URL("http://company.example:80/test/this/here"));
|
||||
this.responseBuilder = new MockWebResponseBuilder(System.currentTimeMillis(), this.webRequest, this.response);
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
|
||||
* @author Sam Brannen
|
||||
* @since 4.2
|
||||
*/
|
||||
public class UrlRegexRequestMatcherTests extends AbstractWebRequestMatcherTests {
|
||||
class UrlRegexRequestMatcherTests extends AbstractWebRequestMatcherTests {
|
||||
|
||||
@Test
|
||||
void verifyExampleInClassLevelJavadoc() throws Exception {
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public class AbstractMockMultipartHttpServletRequestBuilderTests {
|
||||
class AbstractMockMultipartHttpServletRequestBuilderTests {
|
||||
|
||||
private final ServletContext servletContext = new MockServletContext();
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Tests for {@link MockMultipartHttpServletRequestBuilder}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class MockMultipartHttpServletRequestBuilderTests {
|
||||
class MockMultipartHttpServletRequestBuilderTests {
|
||||
|
||||
@Test // gh-26166
|
||||
void addFileAndParts() throws Exception {
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
/**
|
||||
* @author Craig Walls
|
||||
*/
|
||||
public class FlashAttributeResultMatchersTests {
|
||||
class FlashAttributeResultMatchersTests {
|
||||
|
||||
@Test
|
||||
void attributeExists() throws Exception {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import org.springframework.test.web.servlet.StubMvcResult;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class HeaderResultMatchersTests {
|
||||
class HeaderResultMatchersTests {
|
||||
|
||||
private final HeaderResultMatchers matchers = new HeaderResultMatchers();
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
* @author Brian Clozel
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
public class MockMvcResultMatchersTests {
|
||||
class MockMvcResultMatchersTests {
|
||||
|
||||
@Test
|
||||
void redirect() throws Exception {
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.fail;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class StatusResultMatchersTests {
|
||||
class StatusResultMatchersTests {
|
||||
|
||||
private final StatusResultMatchers matchers = new StatusResultMatchers();
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class XpathResultMatchersTests {
|
||||
class XpathResultMatchersTests {
|
||||
|
||||
private static final String RESPONSE_CONTENT = "<foo><bar>111</bar><bar>true</bar></foo>";
|
||||
|
||||
|
||||
+2
-2
@@ -57,7 +57,7 @@ import static org.mockito.Mockito.mock;
|
||||
@WebAppConfiguration
|
||||
@ContextHierarchy(@ContextConfiguration(classes = AsyncControllerJavaConfigTests.WebConfig.class))
|
||||
@DisabledInAotMode("@ContextHierarchy is not supported in AOT")
|
||||
public class AsyncControllerJavaConfigTests {
|
||||
class AsyncControllerJavaConfigTests {
|
||||
|
||||
@Autowired
|
||||
private WebApplicationContext wac;
|
||||
@@ -69,7 +69,7 @@ public class AsyncControllerJavaConfigTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.testClient = MockMvcWebTestClient.bindToApplicationContext(this.wac).build();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -50,7 +50,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
@ContextConfiguration("../../context/servlet-context.xml")
|
||||
})
|
||||
@DisabledInAotMode("@ContextHierarchy is not supported in AOT")
|
||||
public class WebAppResourceTests {
|
||||
class WebAppResourceTests {
|
||||
|
||||
@Autowired
|
||||
private WebApplicationContext wac;
|
||||
@@ -59,7 +59,7 @@ public class WebAppResourceTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.testClient = MockMvcWebTestClient.bindToApplicationContext(this.wac).build();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ import static org.mockito.BDDMockito.given;
|
||||
@ContextConfiguration("../../context/servlet-context.xml")
|
||||
})
|
||||
@DisabledInAotMode("@ContextHierarchy is not supported in AOT")
|
||||
public class XmlConfigTests {
|
||||
class XmlConfigTests {
|
||||
|
||||
@Autowired
|
||||
private WebApplicationContext wac;
|
||||
@@ -60,7 +60,7 @@ public class XmlConfigTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.testClient = MockMvcWebTestClient.bindToApplicationContext(this.wac).build();
|
||||
given(this.personDao.getPerson(5L)).willReturn(new Person("Joe"));
|
||||
}
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class FilterTests {
|
||||
class FilterTests {
|
||||
|
||||
@Test
|
||||
void whenFiltersCompleteMvcProcessesRequest() throws Exception {
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class FrameworkExtensionTests {
|
||||
class FrameworkExtensionTests {
|
||||
|
||||
private final WebTestClient client =
|
||||
MockMvcWebTestClient.bindToController(new SampleController())
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class MultipartControllerTests {
|
||||
class MultipartControllerTests {
|
||||
|
||||
private final WebTestClient testClient = MockMvcWebTestClient.bindToController(new MultipartController()).build();
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import static org.springframework.http.MediaType.TEXT_EVENT_STREAM;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ReactiveReturnTypeTests {
|
||||
class ReactiveReturnTypeTests {
|
||||
|
||||
@Test
|
||||
void sseWithFlux() {
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class RedirectTests {
|
||||
class RedirectTests {
|
||||
|
||||
private final WebTestClient testClient =
|
||||
MockMvcWebTestClient.bindToController(new PersonController()).build();
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class RequestParameterTests {
|
||||
class RequestParameterTests {
|
||||
|
||||
@Test
|
||||
void queryParameter() {
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class SseTests {
|
||||
class SseTests {
|
||||
|
||||
private final WebTestClient testClient =
|
||||
MockMvcWebTestClient.bindToController(new SseController()).build();
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
@Disabled
|
||||
public class PrintingResultHandlerSmokeTests {
|
||||
class PrintingResultHandlerSmokeTests {
|
||||
|
||||
private final WebTestClient testClient =
|
||||
MockMvcWebTestClient.bindToController(new SimpleController()).build();
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class CookieAssertionTests {
|
||||
class CookieAssertionTests {
|
||||
|
||||
private static final String COOKIE_NAME = CookieLocaleResolver.DEFAULT_COOKIE_NAME;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CookieAssertionTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
CookieLocaleResolver localeResolver = new CookieLocaleResolver();
|
||||
localeResolver.setCookieDomain("domain");
|
||||
localeResolver.setCookieHttpOnly(true);
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class FlashAttributeAssertionTests {
|
||||
class FlashAttributeAssertionTests {
|
||||
|
||||
private final WebTestClient client =
|
||||
MockMvcWebTestClient.bindToController(new PersonController())
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ import static org.springframework.web.servlet.mvc.method.annotation.MvcUriCompon
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class HandlerAssertionTests {
|
||||
class HandlerAssertionTests {
|
||||
|
||||
private final WebTestClient client =
|
||||
MockMvcWebTestClient.bindToController(new SimpleController())
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class JsonPathAssertionTests {
|
||||
class JsonPathAssertionTests {
|
||||
|
||||
private final WebTestClient client =
|
||||
MockMvcWebTestClient.bindToController(new MusicController())
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ModelAssertionTests {
|
||||
class ModelAssertionTests {
|
||||
|
||||
private final WebTestClient client =
|
||||
MockMvcWebTestClient.bindToController(new SampleController("a string value", 3, new Person("a name")))
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class RequestAttributeAssertionTests {
|
||||
class RequestAttributeAssertionTests {
|
||||
|
||||
private final WebTestClient mainServletClient =
|
||||
MockMvcWebTestClient.bindToController(new SimpleController())
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class SessionAttributeAssertionTests {
|
||||
class SessionAttributeAssertionTests {
|
||||
|
||||
private final WebTestClient client =
|
||||
MockMvcWebTestClient.bindToController(new SimpleController())
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class UrlAssertionTests {
|
||||
class UrlAssertionTests {
|
||||
|
||||
private final WebTestClient testClient =
|
||||
MockMvcWebTestClient.bindToController(new SimpleController()).build();
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ViewNameAssertionTests {
|
||||
class ViewNameAssertionTests {
|
||||
|
||||
private final WebTestClient client =
|
||||
MockMvcWebTestClient.bindToController(new SimpleController())
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class XmlContentAssertionTests {
|
||||
class XmlContentAssertionTests {
|
||||
|
||||
private static final String PEOPLE_XML =
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" +
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ import static org.springframework.web.bind.annotation.RequestMethod.HEAD;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class XpathAssertionTests {
|
||||
class XpathAssertionTests {
|
||||
|
||||
private static final Map<String, String> musicNamespace =
|
||||
Collections.singletonMap("ns", "https://example.org/music/people");
|
||||
|
||||
+2
-2
@@ -63,7 +63,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
@WebAppConfiguration
|
||||
@ContextHierarchy(@ContextConfiguration(classes = AsyncControllerJavaConfigTests.WebConfig.class))
|
||||
@DisabledInAotMode("@ContextHierarchy is not supported in AOT")
|
||||
public class AsyncControllerJavaConfigTests {
|
||||
class AsyncControllerJavaConfigTests {
|
||||
|
||||
@Autowired
|
||||
private WebApplicationContext wac;
|
||||
@@ -75,7 +75,7 @@ public class AsyncControllerJavaConfigTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
@ContextConfiguration(classes = WebConfig.class)
|
||||
})
|
||||
@DisabledInAotMode("@ContextHierarchy is not supported in AOT")
|
||||
public class JavaConfigTests {
|
||||
class JavaConfigTests {
|
||||
|
||||
@Autowired
|
||||
private WebApplicationContext wac;
|
||||
@@ -84,7 +84,7 @@ public class JavaConfigTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
|
||||
verifyRootWacSupport();
|
||||
given(this.personDao.getPerson(5L)).willReturn(new Person("Joe"));
|
||||
|
||||
+2
-2
@@ -50,7 +50,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
@ContextConfiguration("servlet-context.xml")
|
||||
})
|
||||
@DisabledInAotMode("@ContextHierarchy is not supported in AOT")
|
||||
public class WebAppResourceTests {
|
||||
class WebAppResourceTests {
|
||||
|
||||
@Autowired
|
||||
private WebApplicationContext wac;
|
||||
@@ -58,7 +58,7 @@ public class WebAppResourceTests {
|
||||
private MockMvc mockMvc;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).alwaysExpect(status().isOk()).build();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -51,7 +51,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
@ContextConfiguration("servlet-context.xml")
|
||||
})
|
||||
@DisabledInAotMode("@ContextHierarchy is not supported in AOT")
|
||||
public class XmlConfigTests {
|
||||
class XmlConfigTests {
|
||||
|
||||
@Autowired
|
||||
private WebApplicationContext wac;
|
||||
@@ -63,7 +63,7 @@ public class XmlConfigTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
|
||||
given(this.personDao.getPerson(5L)).willReturn(new Person("Joe"));
|
||||
}
|
||||
|
||||
+2
-2
@@ -53,7 +53,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC
|
||||
* @since 4.2
|
||||
* @see RequestContextHolderTests
|
||||
*/
|
||||
public class CustomRequestAttributesRequestContextHolderTests {
|
||||
class CustomRequestAttributesRequestContextHolderTests {
|
||||
|
||||
private static final String FROM_CUSTOM_MOCK = "fromCustomMock";
|
||||
private static final String FROM_MVC_TEST_DEFAULT = "fromSpringMvcTestDefault";
|
||||
@@ -65,7 +65,7 @@ public class CustomRequestAttributesRequestContextHolderTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
void setUp() {
|
||||
ServletContext servletContext = new MockServletContext();
|
||||
MockHttpServletRequest mockRequest = new MockHttpServletRequest(servletContext);
|
||||
mockRequest.setAttribute(FROM_CUSTOM_MOCK, FROM_CUSTOM_MOCK);
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
@SpringJUnitWebConfig
|
||||
public class EncodedUriTests {
|
||||
class EncodedUriTests {
|
||||
|
||||
private final MockMvc mockMvc;
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class FormContentTests {
|
||||
class FormContentTests {
|
||||
|
||||
@Test // SPR-15753
|
||||
void formContentIsNotDuplicated() throws Exception {
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC
|
||||
* @author Arnaud Cogoluègnes
|
||||
*/
|
||||
@SpringJUnitWebConfig
|
||||
public class HttpOptionsTests {
|
||||
class HttpOptionsTests {
|
||||
|
||||
private final WebApplicationContext wac;
|
||||
|
||||
|
||||
+2
-2
@@ -72,7 +72,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC
|
||||
@WebAppConfiguration
|
||||
@ContextConfiguration
|
||||
@DirtiesContext
|
||||
public class RequestContextHolderTests {
|
||||
class RequestContextHolderTests {
|
||||
|
||||
private static final String FROM_TCF_MOCK = "fromTestContextFrameworkMock";
|
||||
private static final String FROM_MVC_TEST_DEFAULT = "fromSpringMvcTestDefault";
|
||||
@@ -102,7 +102,7 @@ public class RequestContextHolderTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.mockRequest.setAttribute(FROM_TCF_MOCK, FROM_TCF_MOCK);
|
||||
|
||||
this.mockMvc = webAppContextSetup(this.wac)
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
* Tests demonstrating the use of API version.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ApiVersionTests {
|
||||
class ApiVersionTests {
|
||||
|
||||
@Test
|
||||
void queryParameter() throws Exception {
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
public class ExceptionHandlerTests {
|
||||
class ExceptionHandlerTests {
|
||||
|
||||
@Nested
|
||||
class MvcTests {
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
* Tests with {@link Filter}'s.
|
||||
* @author Rob Winch
|
||||
*/
|
||||
public class FilterTests {
|
||||
class FilterTests {
|
||||
|
||||
@Test
|
||||
void whenFiltersCompleteMvcProcessesRequest() throws Exception {
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.1
|
||||
*/
|
||||
public class FrameworkExtensionTests {
|
||||
class FrameworkExtensionTests {
|
||||
|
||||
private final MockMvc mockMvc = standaloneSetup(new SampleController()).apply(defaultSetup()).build();
|
||||
|
||||
|
||||
+1
-2
@@ -39,8 +39,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ReactiveReturnTypeTests {
|
||||
|
||||
class ReactiveReturnTypeTests {
|
||||
|
||||
@Test // SPR-16869
|
||||
void sseWithFlux() throws Exception {
|
||||
|
||||
+2
-2
@@ -45,13 +45,13 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Juergen Hoeller
|
||||
*/
|
||||
public class RedirectTests {
|
||||
class RedirectTests {
|
||||
|
||||
private MockMvc mockMvc;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.mockMvc = standaloneSetup(new PersonController()).build();
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -36,11 +36,10 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class RequestParameterTests {
|
||||
class RequestParameterTests {
|
||||
|
||||
@Test
|
||||
void queryParameter() throws Exception {
|
||||
|
||||
standaloneSetup(new PersonController()).build()
|
||||
.perform(get("/search?name=George").accept(MediaType.APPLICATION_JSON))
|
||||
.andExpect(status().isOk())
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ import static org.springframework.web.servlet.function.ServerResponse.ok;
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class RouterFunctionTests {
|
||||
class RouterFunctionTests {
|
||||
|
||||
private MockMvc mockMvc = routerFunctions(testRoute()).defaultResponseCharacterEncoding(UTF_8).build();
|
||||
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
* @see org.springframework.test.web.servlet.result.PrintingResultHandlerTests
|
||||
*/
|
||||
@Disabled
|
||||
public class PrintingResultHandlerSmokeTests {
|
||||
class PrintingResultHandlerSmokeTests {
|
||||
|
||||
// Not intended to be executed with the build.
|
||||
// Comment out class-level @Disabled to see the output.
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
* @see XmlContentAssertionTests
|
||||
* @see XpathAssertionTests
|
||||
*/
|
||||
public class ContentAssertionTests {
|
||||
class ContentAssertionTests {
|
||||
|
||||
private final MockMvc mockMvc = standaloneSetup(new SimpleController()).alwaysExpect(status().isOk()).build();
|
||||
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Nikola Yovchev
|
||||
*/
|
||||
public class CookieAssertionTests {
|
||||
class CookieAssertionTests {
|
||||
|
||||
private static final String COOKIE_NAME = CookieLocaleResolver.DEFAULT_COOKIE_NAME;
|
||||
private static final String COOKIE_WITH_ATTRIBUTES_NAME = "SecondCookie";
|
||||
@@ -55,7 +55,7 @@ public class CookieAssertionTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
CookieLocaleResolver localeResolver = new CookieLocaleResolver();
|
||||
localeResolver.setCookieDomain("domain");
|
||||
localeResolver.setCookieHttpOnly(true);
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
public class FlashAttributeAssertionTests {
|
||||
class FlashAttributeAssertionTests {
|
||||
|
||||
private final MockMvc mockMvc = standaloneSetup(new PersonController())
|
||||
.alwaysExpect(status().isFound())
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ import static org.springframework.web.servlet.mvc.method.annotation.MvcUriCompon
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
public class HandlerAssertionTests {
|
||||
class HandlerAssertionTests {
|
||||
|
||||
private final MockMvc mockMvc = standaloneSetup(new SimpleController()).alwaysExpect(status().isOk()).build();
|
||||
|
||||
|
||||
+2
-2
@@ -57,7 +57,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
|
||||
* @author Sam Brannen
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
public class HeaderAssertionTests {
|
||||
class HeaderAssertionTests {
|
||||
|
||||
private static final String ERROR_MESSAGE = "Should have thrown an AssertionError";
|
||||
|
||||
@@ -74,7 +74,7 @@ public class HeaderAssertionTests {
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
this.dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US);
|
||||
this.dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
this.now = dateFormat.format(new Date(this.currentTime));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user