Browse Source

Minor improvements in spring-test

- Remove final modifier from private method
- Use StandardCharsets
- Remove unnecessary toString calls
- Remove unnecessary static modifiers
- Refactor to use enhanced switch
- Replace concatenated strings with text blocks
- Rely on auto-boxing where appropriate
- Remove unnecessary code
- Fix imports in Kotlin test classes

Closes gh-29413
pull/27328/merge
Kulwant Singh 2 years ago committed by Sam Brannen
parent
commit
debe78b7f9
  1. 2
      spring-test/src/main/java/org/springframework/test/context/junit/jupiter/AbstractExpressionEvaluatingCondition.java
  2. 2
      spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java
  3. 2
      spring-test/src/main/java/org/springframework/test/context/testng/AbstractTestNGSpringContextTests.java
  4. 2
      spring-test/src/main/java/org/springframework/test/util/XmlExpectationsHelper.java
  5. 2
      spring-test/src/test/java/org/springframework/test/context/configuration/interfaces/BootstrapWithTestInterface.java
  6. 2
      spring-test/src/test/java/org/springframework/test/context/configuration/interfaces/ContextConfigurationTestInterface.java
  7. 2
      spring-test/src/test/java/org/springframework/test/context/configuration/interfaces/WebAppConfigurationTestInterface.java
  8. 8
      spring-test/src/test/java/org/springframework/test/context/junit4/annotation/meta/ConfigClassesAndProfileResolverWithCustomDefaultsMetaConfig.java
  9. 4
      spring-test/src/test/java/org/springframework/test/context/junit4/annotation/meta/ConfigClassesAndProfilesWithCustomDefaultsMetaConfig.java
  10. 23
      spring-test/src/test/java/org/springframework/test/context/junit4/rules/ProgrammaticTxMgmtSpringRuleTests.java
  11. 2
      spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/AnnotatedConfigClassesWithoutAtConfigurationTests.java
  12. 2
      spring-test/src/test/java/org/springframework/test/context/support/DelegatingSmartContextLoaderTests.java
  13. 23
      spring-test/src/test/java/org/springframework/test/context/testng/transaction/programmatic/ProgrammaticTxMgmtTestNGTests.java
  14. 23
      spring-test/src/test/java/org/springframework/test/context/transaction/programmatic/ProgrammaticTxMgmtTests.java
  15. 50
      spring-test/src/test/java/org/springframework/test/util/ReflectionTestUtilsTests.java
  16. 8
      spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java
  17. 47
      spring-test/src/test/java/org/springframework/test/web/client/SimpleRequestExpectationManagerTests.java
  18. 30
      spring-test/src/test/java/org/springframework/test/web/client/UnorderedRequestExpectationManagerTests.java
  19. 7
      spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/SoftAssertionTests.java
  20. 3
      spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java
  21. 2
      spring-test/src/test/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilderTests.java
  22. 6
      spring-test/src/test/java/org/springframework/test/web/servlet/result/ContentResultMatchersTests.java
  23. 4
      spring-test/src/test/java/org/springframework/test/web/servlet/result/JsonPathResultMatchersTests.java
  24. 9
      spring-test/src/test/java/org/springframework/test/web/servlet/result/PrintingResultHandlerTests.java
  25. 23
      spring-test/src/test/java/org/springframework/test/web/servlet/result/StatusResultMatchersTests.java
  26. 13
      spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/ExceptionHandlerTests.java
  27. 11
      spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/XpathAssertionTests.java
  28. 13
      spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ExceptionHandlerTests.java
  29. 18
      spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/MultipartControllerTests.java
  30. 2
      spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resulthandlers/PrintingResultHandlerSmokeTests.java
  31. 8
      spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ContentAssertionTests.java
  32. 11
      spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/XpathAssertionTests.java
  33. 18
      spring-test/src/test/kotlin/org/springframework/test/web/servlet/MockMvcExtensionsTests.kt

2
spring-test/src/main/java/org/springframework/test/context/junit/jupiter/AbstractExpressionEvaluatingCondition.java

@ -93,7 +93,7 @@ abstract class AbstractExpressionEvaluatingCondition implements ExecutionConditi @@ -93,7 +93,7 @@ abstract class AbstractExpressionEvaluatingCondition implements ExecutionConditi
AnnotatedElement element = context.getElement().get();
Optional<A> annotation = findMergedAnnotation(element, annotationType);
if (!annotation.isPresent()) {
if (annotation.isEmpty()) {
String reason = String.format("%s is enabled since @%s is not present", element,
annotationType.getSimpleName());
if (logger.isDebugEnabled()) {

2
spring-test/src/main/java/org/springframework/test/context/support/AbstractGenericContextLoader.java

@ -188,7 +188,7 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader @@ -188,7 +188,7 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
* register a JVM shutdown hook for it
* @return a new application context
*/
private final GenericApplicationContext loadContext(
private GenericApplicationContext loadContext(
MergedContextConfiguration mergedConfig, boolean forAotProcessing) throws Exception {
if (logger.isTraceEnabled()) {

2
spring-test/src/main/java/org/springframework/test/context/testng/AbstractTestNGSpringContextTests.java

@ -201,7 +201,7 @@ public abstract class AbstractTestNGSpringContextTests implements IHookable, App @@ -201,7 +201,7 @@ public abstract class AbstractTestNGSpringContextTests implements IHookable, App
private Throwable getTestResultException(ITestResult testResult) {
Throwable testResultException = testResult.getThrowable();
if (testResultException instanceof InvocationTargetException) {
testResultException = ((InvocationTargetException) testResultException).getCause();
testResultException = testResultException.getCause();
}
return testResultException;
}

2
spring-test/src/main/java/org/springframework/test/util/XmlExpectationsHelper.java

@ -82,7 +82,7 @@ public class XmlExpectationsHelper { @@ -82,7 +82,7 @@ public class XmlExpectationsHelper {
public void assertXmlEqual(String expected, String actual) throws Exception {
XmlUnitDiff diff = new XmlUnitDiff(expected, actual);
if (diff.hasDifferences()) {
AssertionErrors.fail("Body content " + diff.toString());
AssertionErrors.fail("Body content " + diff);
}
}

2
spring-test/src/test/java/org/springframework/test/context/configuration/interfaces/BootstrapWithTestInterface.java

@ -34,7 +34,7 @@ import static java.util.Collections.singletonList; @@ -34,7 +34,7 @@ import static java.util.Collections.singletonList;
@BootstrapWith(CustomTestContextBootstrapper.class)
interface BootstrapWithTestInterface {
static class CustomTestContextBootstrapper extends DefaultTestContextBootstrapper {
class CustomTestContextBootstrapper extends DefaultTestContextBootstrapper {
@Override
protected List<ContextCustomizerFactory> getContextCustomizerFactories() {

2
spring-test/src/test/java/org/springframework/test/context/configuration/interfaces/ContextConfigurationTestInterface.java

@ -28,7 +28,7 @@ import org.springframework.test.context.configuration.interfaces.ContextConfigur @@ -28,7 +28,7 @@ import org.springframework.test.context.configuration.interfaces.ContextConfigur
@ContextConfiguration(classes = Config.class)
interface ContextConfigurationTestInterface {
static class Config {
class Config {
@Bean
Employee employee() {

2
spring-test/src/test/java/org/springframework/test/context/configuration/interfaces/WebAppConfigurationTestInterface.java

@ -30,7 +30,7 @@ import org.springframework.test.context.web.WebAppConfiguration; @@ -30,7 +30,7 @@ import org.springframework.test.context.web.WebAppConfiguration;
interface WebAppConfigurationTestInterface {
@Configuration
static class Config {
class Config {
/* no user beans required for these tests */
}

8
spring-test/src/test/java/org/springframework/test/context/junit4/annotation/meta/ConfigClassesAndProfileResolverWithCustomDefaultsMetaConfig.java

@ -52,7 +52,7 @@ public @interface ConfigClassesAndProfileResolverWithCustomDefaultsMetaConfig { @@ -52,7 +52,7 @@ public @interface ConfigClassesAndProfileResolverWithCustomDefaultsMetaConfig {
@Configuration
@Profile("dev")
static class DevConfig {
class DevConfig {
@Bean
public String foo() {
@ -62,7 +62,7 @@ public @interface ConfigClassesAndProfileResolverWithCustomDefaultsMetaConfig { @@ -62,7 +62,7 @@ public @interface ConfigClassesAndProfileResolverWithCustomDefaultsMetaConfig {
@Configuration
@Profile("prod")
static class ProductionConfig {
class ProductionConfig {
@Bean
public String foo() {
@ -72,7 +72,7 @@ public @interface ConfigClassesAndProfileResolverWithCustomDefaultsMetaConfig { @@ -72,7 +72,7 @@ public @interface ConfigClassesAndProfileResolverWithCustomDefaultsMetaConfig {
@Configuration
@Profile("resolver")
static class ResolverConfig {
class ResolverConfig {
@Bean
public String foo() {
@ -80,7 +80,7 @@ public @interface ConfigClassesAndProfileResolverWithCustomDefaultsMetaConfig { @@ -80,7 +80,7 @@ public @interface ConfigClassesAndProfileResolverWithCustomDefaultsMetaConfig {
}
}
static class CustomResolver implements ActiveProfilesResolver {
class CustomResolver implements ActiveProfilesResolver {
@Override
public String[] resolve(Class<?> testClass) {

4
spring-test/src/test/java/org/springframework/test/context/junit4/annotation/meta/ConfigClassesAndProfilesWithCustomDefaultsMetaConfig.java

@ -50,7 +50,7 @@ public @interface ConfigClassesAndProfilesWithCustomDefaultsMetaConfig { @@ -50,7 +50,7 @@ public @interface ConfigClassesAndProfilesWithCustomDefaultsMetaConfig {
@Configuration
@Profile("dev")
static class DevConfig {
class DevConfig {
@Bean
public String foo() {
@ -60,7 +60,7 @@ public @interface ConfigClassesAndProfilesWithCustomDefaultsMetaConfig { @@ -60,7 +60,7 @@ public @interface ConfigClassesAndProfilesWithCustomDefaultsMetaConfig {
@Configuration
@Profile("prod")
static class ProductionConfig {
class ProductionConfig {
@Bean
public String foo() {

23
spring-test/src/test/java/org/springframework/test/context/junit4/rules/ProgrammaticTxMgmtSpringRuleTests.java

@ -97,24 +97,11 @@ public class ProgrammaticTxMgmtSpringRuleTests { @@ -97,24 +97,11 @@ public class ProgrammaticTxMgmtSpringRuleTests {
void afterTransaction() {
String method = this.testName.getMethodName();
switch (method) {
case "commitTxAndStartNewTx":
case "commitTxButDoNotStartNewTx": {
assertUsers("Dogbert");
break;
}
case "rollbackTxAndStartNewTx":
case "rollbackTxButDoNotStartNewTx":
case "startTxWithExistingTransaction": {
assertUsers("Dilbert");
break;
}
case "rollbackTxAndStartNewTxWithDefaultCommitSemantics": {
assertUsers("Dilbert", "Dogbert");
break;
}
default: {
fail("missing 'after transaction' assertion for test method: " + method);
}
case "commitTxAndStartNewTx", "commitTxButDoNotStartNewTx" -> assertUsers("Dogbert");
case "rollbackTxAndStartNewTx", "rollbackTxButDoNotStartNewTx", "startTxWithExistingTransaction" ->
assertUsers("Dilbert");
case "rollbackTxAndStartNewTxWithDefaultCommitSemantics" -> assertUsers("Dilbert", "Dogbert");
default -> fail("missing 'after transaction' assertion for test method: " + method);
}
}

2
spring-test/src/test/java/org/springframework/test/context/junit4/spr9051/AnnotatedConfigClassesWithoutAtConfigurationTests.java

@ -94,7 +94,7 @@ public class AnnotatedConfigClassesWithoutAtConfigurationTests { @@ -94,7 +94,7 @@ public class AnnotatedConfigClassesWithoutAtConfigurationTests {
assertThat(lifecycleBean).isNotNull();
assertThat(lifecycleBean.isInitialized()).isTrue();
Set<String> names = new HashSet<>();
names.add(enigma.toString());
names.add(enigma);
names.add(lifecycleBean.getName());
assertThat(new HashSet<>(Arrays.asList("enigma #1", "enigma #2"))).isEqualTo(names);
}

2
spring-test/src/test/java/org/springframework/test/context/support/DelegatingSmartContextLoaderTests.java

@ -219,7 +219,7 @@ class DelegatingSmartContextLoaderTests { @@ -219,7 +219,7 @@ class DelegatingSmartContextLoaderTests {
@Bean
public String foo() {
return new String("foo");
return "foo";
}
}

23
spring-test/src/test/java/org/springframework/test/context/testng/transaction/programmatic/ProgrammaticTxMgmtTestNGTests.java

@ -73,24 +73,11 @@ public class ProgrammaticTxMgmtTestNGTests extends AbstractTransactionalTestNGSp @@ -73,24 +73,11 @@ public class ProgrammaticTxMgmtTestNGTests extends AbstractTransactionalTestNGSp
@AfterTransaction
public void afterTransaction() {
switch (this.methodName) {
case "commitTxAndStartNewTx":
case "commitTxButDoNotStartNewTx": {
assertUsers("Dogbert");
break;
}
case "rollbackTxAndStartNewTx":
case "rollbackTxButDoNotStartNewTx":
case "startTxWithExistingTransaction": {
assertUsers("Dilbert");
break;
}
case "rollbackTxAndStartNewTxWithDefaultCommitSemantics": {
assertUsers("Dilbert", "Dogbert");
break;
}
default: {
fail("missing 'after transaction' assertion for test method: " + this.methodName);
}
case "commitTxAndStartNewTx", "commitTxButDoNotStartNewTx" -> assertUsers("Dogbert");
case "rollbackTxAndStartNewTx", "rollbackTxButDoNotStartNewTx", "startTxWithExistingTransaction" ->
assertUsers("Dilbert");
case "rollbackTxAndStartNewTxWithDefaultCommitSemantics" -> assertUsers("Dilbert", "Dogbert");
default -> fail("missing 'after transaction' assertion for test method: " + this.methodName);
}
}

23
spring-test/src/test/java/org/springframework/test/context/transaction/programmatic/ProgrammaticTxMgmtTests.java

@ -88,24 +88,11 @@ class ProgrammaticTxMgmtTests { @@ -88,24 +88,11 @@ class ProgrammaticTxMgmtTests {
@AfterTransaction
void afterTransaction() {
switch (this.methodName) {
case "commitTxAndStartNewTx":
case "commitTxButDoNotStartNewTx": {
assertUsers("Dogbert");
break;
}
case "rollbackTxAndStartNewTx":
case "rollbackTxButDoNotStartNewTx":
case "startTxWithExistingTransaction": {
assertUsers("Dilbert");
break;
}
case "rollbackTxAndStartNewTxWithDefaultCommitSemantics": {
assertUsers("Dilbert", "Dogbert");
break;
}
default: {
fail("missing 'after transaction' assertion for test method: " + this.methodName);
}
case "commitTxAndStartNewTx", "commitTxButDoNotStartNewTx" -> assertUsers("Dogbert");
case "rollbackTxAndStartNewTx", "rollbackTxButDoNotStartNewTx", "startTxWithExistingTransaction" ->
assertUsers("Dilbert");
case "rollbackTxAndStartNewTxWithDefaultCommitSemantics" -> assertUsers("Dilbert", "Dogbert");
default -> fail("missing 'after transaction' assertion for test method: " + this.methodName);
}
}

50
spring-test/src/test/java/org/springframework/test/util/ReflectionTestUtilsTests.java

@ -46,7 +46,7 @@ import static org.springframework.test.util.ReflectionTestUtils.setField; @@ -46,7 +46,7 @@ import static org.springframework.test.util.ReflectionTestUtils.setField;
*/
class ReflectionTestUtilsTests {
private static final Float PI = Float.valueOf((float) 22 / 7);
private static final Float PI = (float) 22 / 7;
private final Person person = new PersonEntity();
@ -64,7 +64,7 @@ class ReflectionTestUtilsTests { @@ -64,7 +64,7 @@ class ReflectionTestUtilsTests {
@Test
void setFieldWithNullTargetObject() throws Exception {
assertThatIllegalArgumentException()
.isThrownBy(() -> setField((Object) null, "id", Long.valueOf(99)))
.isThrownBy(() -> setField((Object) null, "id", 99L))
.withMessageStartingWith("Either targetObject or targetClass");
}
@ -78,7 +78,7 @@ class ReflectionTestUtilsTests { @@ -78,7 +78,7 @@ class ReflectionTestUtilsTests {
@Test
void setFieldWithNullTargetClass() throws Exception {
assertThatIllegalArgumentException()
.isThrownBy(() -> setField((Class<?>) null, "id", Long.valueOf(99)))
.isThrownBy(() -> setField((Class<?>) null, "id", 99L))
.withMessageStartingWith("Either targetObject or targetClass");
}
@ -92,21 +92,21 @@ class ReflectionTestUtilsTests { @@ -92,21 +92,21 @@ class ReflectionTestUtilsTests {
@Test
void setFieldWithNullNameAndNullType() throws Exception {
assertThatIllegalArgumentException()
.isThrownBy(() -> setField(person, null, Long.valueOf(99), null))
.isThrownBy(() -> setField(person, null, 99L, null))
.withMessageStartingWith("Either name or type");
}
@Test
void setFieldWithBogusName() throws Exception {
assertThatIllegalArgumentException()
.isThrownBy(() -> setField(person, "bogus", Long.valueOf(99), long.class))
.isThrownBy(() -> setField(person, "bogus", 99L, long.class))
.withMessageStartingWith("Could not find field 'bogus'");
}
@Test
void setFieldWithWrongType() throws Exception {
assertThatIllegalArgumentException()
.isThrownBy(() -> setField(person, "id", Long.valueOf(99), String.class))
.isThrownBy(() -> setField(person, "id", 99L, String.class))
.withMessageStartingWith("Could not find field");
}
@ -135,17 +135,17 @@ class ReflectionTestUtilsTests { @@ -135,17 +135,17 @@ class ReflectionTestUtilsTests {
private static void assertSetFieldAndGetFieldBehavior(Person person) {
// Set reflectively
setField(person, "id", Long.valueOf(99), long.class);
setField(person, "id", 99L, long.class);
setField(person, "name", "Tom");
setField(person, "age", Integer.valueOf(42));
setField(person, "age", 42);
setField(person, "eyeColor", "blue", String.class);
setField(person, "likesPets", Boolean.TRUE);
setField(person, "favoriteNumber", PI, Number.class);
// Get reflectively
assertThat(getField(person, "id")).isEqualTo(Long.valueOf(99));
assertThat(getField(person, "id")).isEqualTo(99L);
assertThat(getField(person, "name")).isEqualTo("Tom");
assertThat(getField(person, "age")).isEqualTo(Integer.valueOf(42));
assertThat(getField(person, "age")).isEqualTo(42);
assertThat(getField(person, "eyeColor")).isEqualTo("blue");
assertThat(getField(person, "likesPets")).isEqualTo(Boolean.TRUE);
assertThat(getField(person, "favoriteNumber")).isEqualTo(PI);
@ -249,33 +249,33 @@ class ReflectionTestUtilsTests { @@ -249,33 +249,33 @@ class ReflectionTestUtilsTests {
@Test
void invokeSetterMethodAndInvokeGetterMethodWithExplicitMethodNames() throws Exception {
invokeSetterMethod(person, "setId", Long.valueOf(1), long.class);
invokeSetterMethod(person, "setId", 1L, long.class);
invokeSetterMethod(person, "setName", "Jerry", String.class);
invokeSetterMethod(person, "setAge", Integer.valueOf(33), int.class);
invokeSetterMethod(person, "setAge", 33, int.class);
invokeSetterMethod(person, "setEyeColor", "green", String.class);
invokeSetterMethod(person, "setLikesPets", Boolean.FALSE, boolean.class);
invokeSetterMethod(person, "setFavoriteNumber", Integer.valueOf(42), Number.class);
invokeSetterMethod(person, "setFavoriteNumber", 42, Number.class);
assertThat(person.getId()).as("ID (protected method in a superclass)").isEqualTo(1);
assertThat(person.getName()).as("name (private method)").isEqualTo("Jerry");
assertThat(person.getAge()).as("age (protected method)").isEqualTo(33);
assertThat(person.getEyeColor()).as("eye color (package private method)").isEqualTo("green");
assertThat(person.likesPets()).as("'likes pets' flag (protected method for a boolean)").isFalse();
assertThat(person.getFavoriteNumber()).as("'favorite number' (protected method for a Number)").isEqualTo(Integer.valueOf(42));
assertThat(person.getFavoriteNumber()).as("'favorite number' (protected method for a Number)").isEqualTo(42);
assertThat(invokeGetterMethod(person, "getId")).isEqualTo(Long.valueOf(1));
assertThat(invokeGetterMethod(person, "getId")).isEqualTo(1L);
assertThat(invokeGetterMethod(person, "getName")).isEqualTo("Jerry");
assertThat(invokeGetterMethod(person, "getAge")).isEqualTo(Integer.valueOf(33));
assertThat(invokeGetterMethod(person, "getAge")).isEqualTo(33);
assertThat(invokeGetterMethod(person, "getEyeColor")).isEqualTo("green");
assertThat(invokeGetterMethod(person, "likesPets")).isEqualTo(Boolean.FALSE);
assertThat(invokeGetterMethod(person, "getFavoriteNumber")).isEqualTo(Integer.valueOf(42));
assertThat(invokeGetterMethod(person, "getFavoriteNumber")).isEqualTo(42);
}
@Test
void invokeSetterMethodAndInvokeGetterMethodWithJavaBeanPropertyNames() throws Exception {
invokeSetterMethod(person, "id", Long.valueOf(99), long.class);
invokeSetterMethod(person, "id", 99L, long.class);
invokeSetterMethod(person, "name", "Tom");
invokeSetterMethod(person, "age", Integer.valueOf(42));
invokeSetterMethod(person, "age", 42);
invokeSetterMethod(person, "eyeColor", "blue", String.class);
invokeSetterMethod(person, "likesPets", Boolean.TRUE);
invokeSetterMethod(person, "favoriteNumber", PI, Number.class);
@ -287,9 +287,9 @@ class ReflectionTestUtilsTests { @@ -287,9 +287,9 @@ class ReflectionTestUtilsTests {
assertThat(person.likesPets()).as("'likes pets' flag (protected method for a boolean)").isTrue();
assertThat(person.getFavoriteNumber()).as("'favorite number' (protected method for a Number)").isEqualTo(PI);
assertThat(invokeGetterMethod(person, "id")).isEqualTo(Long.valueOf(99));
assertThat(invokeGetterMethod(person, "id")).isEqualTo(99L);
assertThat(invokeGetterMethod(person, "name")).isEqualTo("Tom");
assertThat(invokeGetterMethod(person, "age")).isEqualTo(Integer.valueOf(42));
assertThat(invokeGetterMethod(person, "age")).isEqualTo(42);
assertThat(invokeGetterMethod(person, "eyeColor")).isEqualTo("blue");
assertThat(invokeGetterMethod(person, "likesPets")).isEqualTo(Boolean.TRUE);
assertThat(invokeGetterMethod(person, "favoriteNumber")).isEqualTo(PI);
@ -349,7 +349,7 @@ class ReflectionTestUtilsTests { @@ -349,7 +349,7 @@ class ReflectionTestUtilsTests {
assertThat(component.getText()).as("text").isNull();
// Simulate autowiring a configuration method
invokeMethod(component, "configure", Integer.valueOf(42), "enigma");
invokeMethod(component, "configure", 42, "enigma");
assertThat(component.getNumber()).as("number should have been configured").isEqualTo(Integer.valueOf(42));
assertThat(component.getText()).as("text should have been configured").isEqualTo("enigma");
@ -380,14 +380,14 @@ class ReflectionTestUtilsTests { @@ -380,14 +380,14 @@ class ReflectionTestUtilsTests {
@Test
void invokeMethodWithTooFewArguments() {
assertThatIllegalStateException()
.isThrownBy(() -> invokeMethod(component, "configure", Integer.valueOf(42)))
.isThrownBy(() -> invokeMethod(component, "configure", 42))
.withMessageStartingWith("Method not found");
}
@Test
void invokeMethodWithTooManyArguments() {
assertThatIllegalStateException()
.isThrownBy(() -> invokeMethod(component, "configure", Integer.valueOf(42), "enigma", "baz", "quux"))
.isThrownBy(() -> invokeMethod(component, "configure", 42, "enigma", "baz", "quux"))
.withMessageStartingWith("Method not found");
}
@ -406,7 +406,7 @@ class ReflectionTestUtilsTests { @@ -406,7 +406,7 @@ class ReflectionTestUtilsTests {
@Test // SPR-14363
void invokeMethodOnLegacyEntityWithSideEffectsInToString() {
invokeMethod(entity, "configure", Integer.valueOf(42), "enigma");
invokeMethod(entity, "configure", 42, "enigma");
assertThat(entity.getNumber()).as("number should have been configured").isEqualTo(Integer.valueOf(42));
assertThat(entity.getText()).as("text should have been configured").isEqualTo("enigma");
}

8
spring-test/src/test/java/org/springframework/test/web/client/MockRestServiceServerTests.java

@ -183,9 +183,11 @@ public class MockRestServiceServerTests { @@ -183,9 +183,11 @@ public class MockRestServiceServerTests {
this.restTemplate.getForObject("/foo", Void.class);
assertThatThrownBy(() -> server1.verify(Duration.ofMillis(100))).hasMessage(
"Further request(s) expected leaving 1 unsatisfied expectation(s).\n" +
"1 request(s) executed:\n" +
"GET /foo, headers: [Accept:\"application/json, application/*+json\"]\n");
"""
Further request(s) expected leaving 1 unsatisfied expectation(s).
1 request(s) executed:
GET /foo, headers: [Accept:"application/json, application/*+json"]
""");
MockRestServiceServer server2 = builder.build();
server2.expect(requestTo("/foo")).andRespond(withSuccess());

47
spring-test/src/test/java/org/springframework/test/web/client/SimpleRequestExpectationManagerTests.java

@ -55,8 +55,10 @@ public class SimpleRequestExpectationManagerTests { @@ -55,8 +55,10 @@ public class SimpleRequestExpectationManagerTests {
this.manager.validateRequest(createRequest(GET, "/foo"));
}
catch (AssertionError error) {
assertThat(error.getMessage()).isEqualTo(("No further requests expected: HTTP GET /foo\n" +
"0 request(s) executed.\n"));
assertThat(error.getMessage()).isEqualTo(("""
No further requests expected: HTTP GET /foo
0 request(s) executed.
"""));
}
}
@ -83,10 +85,12 @@ public class SimpleRequestExpectationManagerTests { @@ -83,10 +85,12 @@ public class SimpleRequestExpectationManagerTests {
this.manager.validateRequest(createRequest(GET, "/bar"));
assertThatExceptionOfType(AssertionError.class).isThrownBy(() ->
this.manager.validateRequest(createRequest(GET, "/baz")))
.withMessage("No further requests expected: HTTP GET /baz\n" +
"2 request(s) executed:\n" +
"GET /foo\n" +
"GET /bar\n");
.withMessage("""
No further requests expected: HTTP GET /baz
2 request(s) executed:
GET /foo
GET /bar
""");
}
@Test
@ -96,8 +100,11 @@ public class SimpleRequestExpectationManagerTests { @@ -96,8 +100,11 @@ public class SimpleRequestExpectationManagerTests {
this.manager.validateRequest(createRequest(GET, "/foo"));
assertThatExceptionOfType(AssertionError.class).isThrownBy(() ->
this.manager.verify())
.withMessage("Further request(s) expected leaving 1 unsatisfied expectation(s).\n" +
"1 request(s) executed:\nGET /foo\n");
.withMessage("""
Further request(s) expected leaving 1 unsatisfied expectation(s).
1 request(s) executed:
GET /foo
""");
}
@Test
@ -124,12 +131,14 @@ public class SimpleRequestExpectationManagerTests { @@ -124,12 +131,14 @@ public class SimpleRequestExpectationManagerTests {
this.manager.validateRequest(createRequest(GET, "/bar"));
assertThatExceptionOfType(AssertionError.class).isThrownBy(() ->
this.manager.validateRequest(createRequest(GET, "/foo")))
.withMessage("No further requests expected: HTTP GET /foo\n" +
"4 request(s) executed:\n" +
"GET /foo\n" +
"GET /bar\n" +
"GET /foo\n" +
"GET /bar\n");
.withMessage("""
No further requests expected: HTTP GET /foo
4 request(s) executed:
GET /foo
GET /bar
GET /foo
GET /bar
""");
}
@Test
@ -141,10 +150,12 @@ public class SimpleRequestExpectationManagerTests { @@ -141,10 +150,12 @@ public class SimpleRequestExpectationManagerTests {
this.manager.validateRequest(createRequest(GET, "/foo"));
assertThatExceptionOfType(AssertionError.class).isThrownBy(() ->
this.manager.verify())
.withMessageContaining("3 request(s) executed:\n" +
"GET /foo\n" +
"GET /bar\n" +
"GET /foo\n");
.withMessageContaining("""
3 request(s) executed:
GET /foo
GET /bar
GET /foo
""");
}
@Test

30
spring-test/src/test/java/org/springframework/test/web/client/UnorderedRequestExpectationManagerTests.java

@ -52,8 +52,10 @@ public class UnorderedRequestExpectationManagerTests { @@ -52,8 +52,10 @@ public class UnorderedRequestExpectationManagerTests {
this.manager.validateRequest(createRequest(GET, "/foo"));
}
catch (AssertionError error) {
assertThat(error.getMessage()).isEqualTo(("No further requests expected: HTTP GET /foo\n" +
"0 request(s) executed.\n"));
assertThat(error.getMessage()).isEqualTo(("""
No further requests expected: HTTP GET /foo
0 request(s) executed.
"""));
}
}
@ -94,12 +96,14 @@ public class UnorderedRequestExpectationManagerTests { @@ -94,12 +96,14 @@ public class UnorderedRequestExpectationManagerTests {
this.manager.validateRequest(createRequest(GET, "/foo"));
assertThatExceptionOfType(AssertionError.class).isThrownBy(() ->
this.manager.validateRequest(createRequest(GET, "/foo")))
.withMessage("No further requests expected: HTTP GET /foo\n" +
"4 request(s) executed:\n" +
"GET /bar\n" +
"GET /foo\n" +
"GET /bar\n" +
"GET /foo\n");
.withMessage("""
No further requests expected: HTTP GET /foo
4 request(s) executed:
GET /bar
GET /foo
GET /bar
GET /foo
""");
}
@Test
@ -111,10 +115,12 @@ public class UnorderedRequestExpectationManagerTests { @@ -111,10 +115,12 @@ public class UnorderedRequestExpectationManagerTests {
this.manager.validateRequest(createRequest(GET, "/foo"));
assertThatExceptionOfType(AssertionError.class)
.isThrownBy(this.manager::verify)
.withMessageContaining("3 request(s) executed:\n" +
"GET /bar\n" +
"GET /foo\n" +
"GET /foo\n");
.withMessageContaining("""
3 request(s) executed:
GET /bar
GET /foo
GET /foo
""");
}

7
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/SoftAssertionTests.java

@ -56,9 +56,10 @@ class SoftAssertionTests { @@ -56,9 +56,10 @@ class SoftAssertionTests {
responseSpec -> responseSpec.expectBody(String.class).isEqualTo("bogus")
)
)
.withMessage("Multiple Exceptions (2):\n" +
"Status expected:<400 BAD_REQUEST> but was:<200 OK>\n" +
"Response body expected:<bogus> but was:<hello>");
.withMessage("""
Multiple Exceptions (2):
Status expected:<400 BAD_REQUEST> but was:<200 OK>
Response body expected:<bogus> but was:<hello>""");
}

3
spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/DelegatingWebConnectionTests.java

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
package org.springframework.test.web.servlet.htmlunit;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import com.gargoylesoftware.htmlunit.HttpWebConnection;
@ -79,7 +80,7 @@ public class DelegatingWebConnectionTests { @@ -79,7 +80,7 @@ public class DelegatingWebConnectionTests {
@BeforeEach
public void setup() throws Exception {
request = new WebRequest(new URL("http://localhost/"));
WebResponseData data = new WebResponseData("".getBytes("UTF-8"), 200, "", Collections.emptyList());
WebResponseData data = new WebResponseData("".getBytes(StandardCharsets.UTF_8), 200, "", Collections.emptyList());
expectedResponse = new WebResponse(data, request, 100L);
webConnection = new DelegatingWebConnection(defaultConnection,
new DelegateWebConnection(matcher1, connection1), new DelegateWebConnection(matcher2, connection2));

2
spring-test/src/test/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilderTests.java

@ -414,7 +414,7 @@ class MockHttpServletRequestBuilderTests { @@ -414,7 +414,7 @@ class MockHttpServletRequestBuilderTests {
@Test
void body() throws IOException {
byte[] body = "Hello World".getBytes("UTF-8");
byte[] body = "Hello World".getBytes(StandardCharsets.UTF_8);
this.builder.content(body);
MockHttpServletRequest request = this.builder.buildRequest(this.servletContext);

6
spring-test/src/test/java/org/springframework/test/web/servlet/result/ContentResultMatchersTests.java

@ -46,7 +46,7 @@ public class ContentResultMatchersTests { @@ -46,7 +46,7 @@ public class ContentResultMatchersTests {
@Test
public void string() throws Exception {
new ContentResultMatchers().string(new String(CONTENT.getBytes("UTF-8"))).match(getStubMvcResult(CONTENT));
new ContentResultMatchers().string(new String(CONTENT.getBytes(StandardCharsets.UTF_8))).match(getStubMvcResult(CONTENT));
}
@Test
@ -57,7 +57,7 @@ public class ContentResultMatchersTests { @@ -57,7 +57,7 @@ public class ContentResultMatchersTests {
@Test
public void stringMatcher() throws Exception {
String content = new String(CONTENT.getBytes("UTF-8"));
String content = new String(CONTENT.getBytes(StandardCharsets.UTF_8));
new ContentResultMatchers().string(Matchers.equalTo(content)).match(getStubMvcResult(CONTENT));
}
@ -69,7 +69,7 @@ public class ContentResultMatchersTests { @@ -69,7 +69,7 @@ public class ContentResultMatchersTests {
@Test
public void bytes() throws Exception {
new ContentResultMatchers().bytes(CONTENT.getBytes("UTF-8")).match(getStubMvcResult(CONTENT));
new ContentResultMatchers().bytes(CONTENT.getBytes(StandardCharsets.UTF_8)).match(getStubMvcResult(CONTENT));
}
@Test

4
spring-test/src/test/java/org/springframework/test/web/servlet/result/JsonPathResultMatchersTests.java

@ -302,7 +302,7 @@ public class JsonPathResultMatchersTests { @@ -302,7 +302,7 @@ public class JsonPathResultMatchersTests {
public void prefixWithPayloadNotLongEnough() throws Exception {
MockHttpServletResponse response = new MockHttpServletResponse();
response.addHeader("Content-Type", "application/json");
response.getWriter().print(new String("test".getBytes("ISO-8859-1")));
response.getWriter().print(new String("test".getBytes(StandardCharsets.ISO_8859_1)));
StubMvcResult result = new StubMvcResult(null, null, null, null, null, null, response);
assertThatExceptionOfType(AssertionError.class).isThrownBy(() ->
@ -312,7 +312,7 @@ public class JsonPathResultMatchersTests { @@ -312,7 +312,7 @@ public class JsonPathResultMatchersTests {
private StubMvcResult createPrefixedStubMvcResult(String jsonPrefix) throws Exception {
MockHttpServletResponse response = new MockHttpServletResponse();
response.addHeader("Content-Type", "application/json");
response.getWriter().print(jsonPrefix + new String(RESPONSE_CONTENT.getBytes("ISO-8859-1")));
response.getWriter().print(jsonPrefix + new String(RESPONSE_CONTENT.getBytes(StandardCharsets.ISO_8859_1)));
return new StubMvcResult(null, null, null, null, null, null, response);
}

9
spring-test/src/test/java/org/springframework/test/web/servlet/result/PrintingResultHandlerTests.java

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
package org.springframework.test.web.servlet.result;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@ -74,7 +75,7 @@ public class PrintingResultHandlerTests { @@ -74,7 +75,7 @@ public class PrintingResultHandlerTests {
this.request.addHeader("header", "headerValue");
this.request.setCharacterEncoding("UTF-16");
String palindrome = "ablE was I ere I saw Elba";
byte[] bytes = palindrome.getBytes("UTF-16");
byte[] bytes = palindrome.getBytes(StandardCharsets.UTF_16);
this.request.setContent(bytes);
this.request.getSession().setAttribute("foo", "bar");
@ -100,7 +101,7 @@ public class PrintingResultHandlerTests { @@ -100,7 +101,7 @@ public class PrintingResultHandlerTests {
this.request.addHeader("header", "headerValue");
this.request.setCharacterEncoding("UTF-16");
String palindrome = "ablE was I ere I saw Elba";
byte[] bytes = palindrome.getBytes("UTF-16");
byte[] bytes = palindrome.getBytes(StandardCharsets.UTF_16);
this.request.setContent(bytes);
this.handler.handle(this.mvcResult);
@ -124,7 +125,7 @@ public class PrintingResultHandlerTests { @@ -124,7 +125,7 @@ public class PrintingResultHandlerTests {
this.request.addHeader("header", "headerValue");
this.request.setCharacterEncoding("UTF-16");
String palindrome = "ablE was I ere I saw Elba";
byte[] bytes = palindrome.getBytes("UTF-16");
byte[] bytes = palindrome.getBytes(StandardCharsets.UTF_16);
this.request.setContent(bytes);
this.request.setSession(Mockito.mock(HttpSession.class));
@ -204,7 +205,7 @@ public class PrintingResultHandlerTests { @@ -204,7 +205,7 @@ public class PrintingResultHandlerTests {
@Test
public void printRequestWithCharacterEncoding() throws Exception {
this.request.setCharacterEncoding("UTF-8");
this.request.setContent("text".getBytes("UTF-8"));
this.request.setContent("text".getBytes(StandardCharsets.UTF_8));
this.handler.handle(this.mvcResult);

23
spring-test/src/test/java/org/springframework/test/web/servlet/result/StatusResultMatchersTests.java

@ -85,23 +85,12 @@ public class StatusResultMatchersTests { @@ -85,23 +85,12 @@ public class StatusResultMatchersTests {
response.setStatus(status.value());
MvcResult mvcResult = new StubMvcResult(request, null, null, null, null, null, response);
switch (status.series().value()) {
case 1:
this.matchers.is1xxInformational().match(mvcResult);
break;
case 2:
this.matchers.is2xxSuccessful().match(mvcResult);
break;
case 3:
this.matchers.is3xxRedirection().match(mvcResult);
break;
case 4:
this.matchers.is4xxClientError().match(mvcResult);
break;
case 5:
this.matchers.is5xxServerError().match(mvcResult);
break;
default:
fail("Unexpected range for status code value " + status);
case 1 -> this.matchers.is1xxInformational().match(mvcResult);
case 2 -> this.matchers.is2xxSuccessful().match(mvcResult);
case 3 -> this.matchers.is3xxRedirection().match(mvcResult);
case 4 -> this.matchers.is4xxClientError().match(mvcResult);
case 5 -> this.matchers.is5xxServerError().match(mvcResult);
default -> fail("Unexpected range for status code value " + status);
}
}
}

13
spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/ExceptionHandlerTests.java

@ -173,14 +173,11 @@ class ExceptionHandlerTests { @@ -173,14 +173,11 @@ class ExceptionHandlerTests {
@GetMapping("/person/{name}")
Person get(@PathVariable String name) {
switch (name) {
case "Luke":
throw new IllegalArgumentException();
case "Leia":
throw new IllegalStateException();
default:
return new Person("Yoda");
}
return switch (name) {
case "Luke" -> throw new IllegalArgumentException();
case "Leia" -> throw new IllegalStateException();
default -> new Person("Yoda");
};
}
@ExceptionHandler

11
spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/XpathAssertionTests.java

@ -224,11 +224,12 @@ public class XpathAssertionTests { @@ -224,11 +224,12 @@ public class XpathAssertionTests {
@RequestMapping(value = "/blog.atom", method = {GET, HEAD})
@ResponseBody
public String listPublishedPosts() {
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
+ "<feed xmlns=\"http://www.w3.org/2005/Atom\">\r\n"
+ " <title>Test Feed</title>\r\n"
+ " <icon>https://www.example.com/favicon.ico</icon>\r\n"
+ "</feed>\r\n\r\n";
return """
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Test Feed</title>
<icon>https://www.example.com/favicon.ico</icon>
</feed>""".replaceAll("\n", "\r\n");
}
}

13
spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ExceptionHandlerTests.java

@ -152,14 +152,11 @@ public class ExceptionHandlerTests { @@ -152,14 +152,11 @@ public class ExceptionHandlerTests {
@GetMapping("/person/{name}")
Person get(@PathVariable String name) {
switch (name) {
case "Luke":
throw new IllegalArgumentException();
case "Leia":
throw new IllegalStateException();
default:
return new Person("Yoda");
}
return switch (name) {
case "Luke" -> throw new IllegalArgumentException();
case "Leia" -> throw new IllegalStateException();
default -> new Person("Yoda");
};
}
@ExceptionHandler

18
spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/MultipartControllerTests.java

@ -70,18 +70,12 @@ class MultipartControllerTests { @@ -70,18 +70,12 @@ class MultipartControllerTests {
byte[] json = "{\"name\":\"yeeeah\"}".getBytes(StandardCharsets.UTF_8);
MockMultipartFile jsonPart = new MockMultipartFile("json", "json", "application/json", json);
MockMultipartHttpServletRequestBuilder requestBuilder;
switch (url) {
case "/multipartfile":
requestBuilder = multipart(url).file(new MockMultipartFile("file", "orig", null, fileContent));
break;
case "/multipartfile-via-put":
requestBuilder = multipart(HttpMethod.PUT, url).file(new MockMultipartFile("file", "orig", null, fileContent));
break;
default:
requestBuilder = multipart(url).part(new MockPart("part", "orig", fileContent));
break;
}
MockMultipartHttpServletRequestBuilder requestBuilder = switch (url) {
case "/multipartfile" -> multipart(url).file(new MockMultipartFile("file", "orig", null, fileContent));
case "/multipartfile-via-put" ->
multipart(HttpMethod.PUT, url).file(new MockMultipartFile("file", "orig", null, fileContent));
default -> multipart(url).part(new MockPart("part", "orig", fileContent));
};
standaloneSetup(new MultipartController()).build()
.perform(requestBuilder.file(jsonPart))

2
spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resulthandlers/PrintingResultHandlerSmokeTests.java

@ -68,7 +68,7 @@ public class PrintingResultHandlerSmokeTests { @@ -68,7 +68,7 @@ public class PrintingResultHandlerSmokeTests {
System.out.println();
System.out.println("===============================================================");
System.out.println(writer.toString());
System.out.println(writer);
}

8
spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ContentAssertionTests.java

@ -79,10 +79,10 @@ public class ContentAssertionTests { @@ -79,10 +79,10 @@ public class ContentAssertionTests {
@Test
void contentAsBytes() throws Exception {
this.mockMvc.perform(get("/handle").accept(MediaType.TEXT_PLAIN))
.andExpect(content().bytes("Hello world!".getBytes("ISO-8859-1")));
.andExpect(content().bytes("Hello world!".getBytes(StandardCharsets.ISO_8859_1)));
this.mockMvc.perform(get("/handleUtf8"))
.andExpect(content().bytes("\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\uff01".getBytes("UTF-8")));
.andExpect(content().bytes("\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\uff01".getBytes(StandardCharsets.UTF_8)));
}
@Test
@ -103,11 +103,11 @@ public class ContentAssertionTests { @@ -103,11 +103,11 @@ public class ContentAssertionTests {
this.mockMvc.perform(get("/handleUtf8"))
.andExpect(content().encoding("UTF-8"))
.andExpect(content().bytes("\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\uff01".getBytes("UTF-8")));
.andExpect(content().bytes("\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\uff01".getBytes(StandardCharsets.UTF_8)));
this.mockMvc.perform(get("/handleUtf8"))
.andExpect(content().encoding(StandardCharsets.UTF_8))
.andExpect(content().bytes("\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\uff01".getBytes("UTF-8")));
.andExpect(content().bytes("\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\uff01".getBytes(StandardCharsets.UTF_8)));
}

11
spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/XpathAssertionTests.java

@ -228,11 +228,12 @@ public class XpathAssertionTests { @@ -228,11 +228,12 @@ public class XpathAssertionTests {
@RequestMapping(value="/blog.atom", method = { GET, HEAD })
@ResponseBody
public String listPublishedPosts() {
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
+ "<feed xmlns=\"http://www.w3.org/2005/Atom\">\r\n"
+ " <title>Test Feed</title>\r\n"
+ " <icon>https://www.example.com/favicon.ico</icon>\r\n"
+ "</feed>\r\n\r\n";
return """
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Test Feed</title>
<icon>https://www.example.com/favicon.ico</icon>
</feed>""".replaceAll("\n", "\r\n");
}
}

18
spring-test/src/test/kotlin/org/springframework/test/web/servlet/MockMvcExtensionsTests.kt

@ -16,21 +16,27 @@ @@ -16,21 +16,27 @@
package org.springframework.test.web.servlet
import org.assertj.core.api.Assertions.*
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.assertThatExceptionOfType
import org.hamcrest.CoreMatchers
import org.hamcrest.Matcher
import org.hamcrest.Matchers
import org.junit.jupiter.api.Test
import org.springframework.http.HttpMethod
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType.*
import org.springframework.http.MediaType.APPLICATION_ATOM_XML
import org.springframework.http.MediaType.APPLICATION_JSON
import org.springframework.http.MediaType.APPLICATION_XML
import org.springframework.test.web.Person
import org.springframework.test.web.servlet.setup.MockMvcBuilders
import org.springframework.web.bind.annotation.*
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.ResponseStatus
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.servlet.ModelAndView
import reactor.core.publisher.Mono
import java.security.Principal
import java.util.*
import java.util.Locale
/**
* [MockMvc] DSL tests that verifies builder, actions and expect blocks.

Loading…
Cancel
Save