Browse Source

Enable SpringJUnit5 Checkstyle rule

See gh-36496
Closes gh-36496
7.0.x
Sam Brannen 3 days ago
parent
commit
1256307c83
  1. 36
      integration-tests/src/test/java/org/springframework/core/env/Constants.java
  2. 42
      integration-tests/src/test/java/org/springframework/core/env/EnvironmentSystemIntegrationTests.java
  3. 2
      integration-tests/src/test/java/org/springframework/core/env/scan1/DevConfig.java
  4. 2
      integration-tests/src/test/java/org/springframework/core/env/scan1/ProdConfig.java
  5. 4
      integration-tests/src/test/java/org/springframework/core/env/scan2/DevBean.java
  6. 4
      integration-tests/src/test/java/org/springframework/core/env/scan2/ProdBean.java
  7. 4
      spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java
  8. 2
      spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJNamespaceHandlerTests.java
  9. 19
      spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java
  10. 4
      spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java
  11. 2
      spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java
  12. 2
      spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java
  13. 4
      spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java
  14. 4
      spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationDrivenBeanDefinitionParserTests.java
  15. 4
      spring-aspects/src/test/java/org/springframework/transaction/aspectj/JtaTransactionAspectsTests.java
  16. 2
      spring-beans/src/test/java/org/springframework/beans/factory/CustomObjectProviderTests.java
  17. 2
      spring-beans/src/test/java/org/springframework/beans/factory/support/BeanRegistryAdapterTests.java
  18. 2
      spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java
  19. 8
      spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAndImportAnnotationInteractionTests.java
  20. 4
      spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorAotContributionTests.java
  21. 2
      spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassWithConditionTests.java
  22. 2
      spring-context/src/test/java/org/springframework/context/annotation/Gh23206Tests.java
  23. 2
      spring-context/src/test/java/org/springframework/context/annotation/Gh32489Tests.java
  24. 2
      spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java
  25. 22
      spring-context/src/test/java/org/springframework/context/annotation/ImportedConfig.java
  26. 2
      spring-context/src/test/java/org/springframework/context/annotation/Spr8954Tests.java
  27. 2
      spring-context/src/test/java/org/springframework/context/annotation/beanregistrar/BeanRegistrarConfigurationTests.java
  28. 4
      spring-context/src/test/java/org/springframework/context/annotation/componentscan/importing/ImportingConfig.java
  29. 20
      spring-context/src/test/java/org/springframework/context/annotation/configuration/Bar.java
  30. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java
  31. 5
      spring-context/src/test/java/org/springframework/context/annotation/configuration/PackagePrivateBeanMethodInheritanceTests.java
  32. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/a/BaseConfig.java
  33. 25
      spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/MarkerAnnotation.java
  34. 8
      spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/Spr9031Tests.java
  35. 2
      spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/scanpackage/Spr9031Component.java
  36. 2
      spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java
  37. 2
      spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java
  38. 2
      spring-context/src/test/java/org/springframework/scripting/config/ScriptingDefaultsTests.java
  39. 2
      spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java
  40. 12
      spring-context/src/testFixtures/java/org/springframework/context/testfixture/cache/AbstractCacheAnnotationTests.java
  41. 2
      spring-core-test/src/test/java/org/springframework/aot/agent/InstrumentedMethodTests.java
  42. 2
      spring-core/src/test/java/org/springframework/core/NullnessTests.java
  43. 2
      spring-core/src/test/java/org/springframework/core/io/buffer/JettyDataBufferTests.java
  44. 8
      spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java
  45. 2
      spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java
  46. 2
      spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationPerformanceTests.java
  47. 2
      spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java
  48. 2
      spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/HeaderMethodArgumentResolverTests.java
  49. 2
      spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/MessageMappingMessageHandlerTests.java
  50. 2
      spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolverTests.java
  51. 2
      spring-messaging/src/test/java/org/springframework/messaging/rsocket/RSocketClientToServerIntegrationTests.java
  52. 2
      spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandlerTests.java
  53. 2
      spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerTests.java
  54. 2
      spring-messaging/src/test/java/org/springframework/messaging/simp/broker/SimpleBrokerMessageHandlerTests.java
  55. 2
      spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/DefaultStompSessionTests.java
  56. 4
      spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/SplittingStompEncoderTests.java
  57. 2
      spring-messaging/src/test/java/org/springframework/messaging/support/ExecutorSubscribableChannelTests.java
  58. 2
      spring-oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTests.java
  59. 2
      spring-oxm/src/test/java/org/springframework/oxm/AbstractUnmarshallerTests.java
  60. 2
      spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/init/ScriptUtilsTests.java
  61. 2
      spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/lookup/BeanFactoryConnectionFactoryLookupTests.java
  62. 2
      spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractDatabaseClientIntegrationTests.java
  63. 10
      spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractTransactionalDatabaseClientIntegrationTests.java
  64. 2
      spring-r2dbc/src/test/java/org/springframework/r2dbc/core/H2DatabaseClientContextIntegrationTests.java
  65. 2
      spring-test/src/test/java/org/springframework/test/context/cache/ContextCacheTestSuite.java
  66. 2
      spring-test/src/test/java/org/springframework/test/context/config/ContextConfigTestSuite.java
  67. 4
      spring-test/src/test/java/org/springframework/test/context/event/CustomTestEventTests.java
  68. 4
      spring-test/src/test/java/org/springframework/test/context/event/EventPublishingTestExecutionListenerIntegrationTests.java
  69. 2
      spring-test/src/test/java/org/springframework/test/context/hierarchies/web/DispatcherWacRootWacEarTests.java
  70. 2
      spring-test/src/test/java/org/springframework/test/context/initializers/AciTestSuite.java
  71. 2
      spring-test/src/test/java/org/springframework/test/context/initializers/annotation/InitializerConfiguredViaMetaAnnotationTests.java
  72. 2
      spring-test/src/test/java/org/springframework/test/context/initializers/annotation/InitializerWithoutConfigFilesOrClassesTests.java
  73. 2
      spring-test/src/test/java/org/springframework/test/context/initializers/annotation/MergedInitializersAnnotationConfigTests.java
  74. 2
      spring-test/src/test/java/org/springframework/test/context/initializers/annotation/MultipleInitializersAnnotationConfigTests.java
  75. 2
      spring-test/src/test/java/org/springframework/test/context/initializers/annotation/OrderedInitializersAnnotationConfigTests.java
  76. 2
      spring-test/src/test/java/org/springframework/test/context/initializers/annotation/OverriddenInitializersAnnotationConfigTests.java
  77. 2
      spring-test/src/test/java/org/springframework/test/context/initializers/annotation/PropertySourcesInitializerTests.java
  78. 2
      spring-test/src/test/java/org/springframework/test/context/initializers/annotation/SingleInitializerAnnotationConfigTests.java
  79. 2
      spring-test/src/test/java/org/springframework/test/context/initializers/xml/MultipleInitializersXmlConfigTests.java
  80. 2
      spring-test/src/test/java/org/springframework/test/context/junit/SpringJUnitJupiterTestSuite.java
  81. 3
      spring-test/src/test/java/org/springframework/test/context/profile/importresource/DevProfileResolverAnnotationConfigTests.java
  82. 2
      spring-test/src/test/java/org/springframework/test/util/ExceptionCollectorTests.java
  83. 2
      spring-test/src/test/java/org/springframework/test/web/client/match/ContentRequestMatchersTests.java
  84. 2
      spring-test/src/test/java/org/springframework/test/web/client/match/JsonPathRequestMatchersTests.java
  85. 4
      spring-test/src/test/java/org/springframework/test/web/client/match/MultipartRequestMatchersTests.java
  86. 4
      spring-test/src/test/java/org/springframework/test/web/client/match/XpathRequestMatchersTests.java
  87. 4
      spring-test/src/test/java/org/springframework/test/web/client/samples/matchers/XpathRequestMatchersIntegrationTests.java
  88. 3
      spring-test/src/test/java/org/springframework/test/web/reactive/server/ApplicationContextSpecTests.java
  89. 2
      spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java
  90. 2
      spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultRouterFunctionSpecTests.java
  91. 2
      spring-test/src/test/java/org/springframework/test/web/reactive/server/HttpHandlerConnectorTests.java
  92. 2
      spring-test/src/test/java/org/springframework/test/web/reactive/server/MockServerSpecTests.java
  93. 3
      spring-test/src/test/java/org/springframework/test/web/reactive/server/MockServerTests.java
  94. 2
      spring-test/src/test/java/org/springframework/test/web/reactive/server/WiretapConnectorTests.java
  95. 2
      spring-test/src/test/java/org/springframework/test/web/reactive/server/assertj/WebTestClientResponseTests.java
  96. 2
      spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/ApiVersionTests.java
  97. 2
      spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/GlobalEntityResultConsumerTests.java
  98. 4
      spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/ControllerTests.java
  99. 6
      spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/HttpServerTests.java
  100. 4
      spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/RouterFunctionTests.java
  101. Some files were not shown because too many files have changed in this diff Show More

36
integration-tests/src/test/java/org/springframework/core/env/Constants.java vendored

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core.env;
/**
* Constants used both locally and in scan* sub-packages
*/
public class Constants {
public static final String XML_PATH = "org/springframework/core/env/EnvironmentSystemIntegrationTests-context.xml";
public static final String ENVIRONMENT_AWARE_BEAN_NAME = "envAwareBean";
public static final String PROD_BEAN_NAME = "prodBean";
public static final String DEV_BEAN_NAME = "devBean";
public static final String DERIVED_DEV_BEAN_NAME = "derivedDevBean";
public static final String TRANSITIVE_BEAN_NAME = "transitiveBean";
public static final String PROD_ENV_NAME = "prod";
public static final String DEV_ENV_NAME = "dev";
public static final String DERIVED_DEV_ENV_NAME = "derivedDev";
}

42
integration-tests/src/test/java/org/springframework/core/env/EnvironmentSystemIntegrationTests.java vendored

@ -58,15 +58,15 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -58,15 +58,15 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition;
import static org.springframework.context.ConfigurableApplicationContext.ENVIRONMENT_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DERIVED_DEV_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DERIVED_DEV_ENV_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_ENV_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.ENVIRONMENT_AWARE_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_ENV_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.TRANSITIVE_BEAN_NAME;
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.XML_PATH;
import static org.springframework.core.env.Constants.DERIVED_DEV_BEAN_NAME;
import static org.springframework.core.env.Constants.DERIVED_DEV_ENV_NAME;
import static org.springframework.core.env.Constants.DEV_BEAN_NAME;
import static org.springframework.core.env.Constants.DEV_ENV_NAME;
import static org.springframework.core.env.Constants.ENVIRONMENT_AWARE_BEAN_NAME;
import static org.springframework.core.env.Constants.PROD_BEAN_NAME;
import static org.springframework.core.env.Constants.PROD_ENV_NAME;
import static org.springframework.core.env.Constants.TRANSITIVE_BEAN_NAME;
import static org.springframework.core.env.Constants.XML_PATH;
/**
* System integration tests for container support of the {@link Environment} API.
@ -87,7 +87,7 @@ import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Con @@ -87,7 +87,7 @@ import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Con
* @author Sam Brannen
* @see org.springframework.context.support.EnvironmentIntegrationTests
*/
public class EnvironmentSystemIntegrationTests {
class EnvironmentSystemIntegrationTests {
private final ConfigurableEnvironment prodEnv = new StandardEnvironment();
@ -648,7 +648,7 @@ public class EnvironmentSystemIntegrationTests { @@ -648,7 +648,7 @@ public class EnvironmentSystemIntegrationTests {
}
}
@Profile(DERIVED_DEV_ENV_NAME)
@Profile(Constants.DERIVED_DEV_ENV_NAME)
@Configuration
static class DerivedDevConfig extends DevConfig {
@Bean
@ -666,24 +666,4 @@ public class EnvironmentSystemIntegrationTests { @@ -666,24 +666,4 @@ public class EnvironmentSystemIntegrationTests {
}
}
/**
* Constants used both locally and in scan* sub-packages
*/
public static class Constants {
public static final String XML_PATH = "org/springframework/core/env/EnvironmentSystemIntegrationTests-context.xml";
public static final String ENVIRONMENT_AWARE_BEAN_NAME = "envAwareBean";
public static final String PROD_BEAN_NAME = "prodBean";
public static final String DEV_BEAN_NAME = "devBean";
public static final String DERIVED_DEV_BEAN_NAME = "derivedDevBean";
public static final String TRANSITIVE_BEAN_NAME = "transitiveBean";
public static final String PROD_ENV_NAME = "prod";
public static final String DEV_ENV_NAME = "dev";
public static final String DERIVED_DEV_ENV_NAME = "derivedDev";
}
}

2
integration-tests/src/test/java/org/springframework/core/env/scan1/DevConfig.java vendored

@ -20,7 +20,7 @@ import org.springframework.context.annotation.Bean; @@ -20,7 +20,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_ENV_NAME)
@Profile(org.springframework.core.env.Constants.DEV_ENV_NAME)
@Configuration
class DevConfig {

2
integration-tests/src/test/java/org/springframework/core/env/scan1/ProdConfig.java vendored

@ -20,7 +20,7 @@ import org.springframework.context.annotation.Bean; @@ -20,7 +20,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_ENV_NAME)
@Profile(org.springframework.core.env.Constants.PROD_ENV_NAME)
@Configuration
class ProdConfig {

4
integration-tests/src/test/java/org/springframework/core/env/scan2/DevBean.java vendored

@ -19,7 +19,7 @@ package org.springframework.core.env.scan2; @@ -19,7 +19,7 @@ package org.springframework.core.env.scan2;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_ENV_NAME)
@Component(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_BEAN_NAME)
@Profile(org.springframework.core.env.Constants.DEV_ENV_NAME)
@Component(org.springframework.core.env.Constants.DEV_BEAN_NAME)
class DevBean {
}

4
integration-tests/src/test/java/org/springframework/core/env/scan2/ProdBean.java vendored

@ -19,8 +19,8 @@ package org.springframework.core.env.scan2; @@ -19,8 +19,8 @@ package org.springframework.core.env.scan2;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_ENV_NAME)
@Component(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_BEAN_NAME)
@Profile(org.springframework.core.env.Constants.PROD_ENV_NAME)
@Component(org.springframework.core.env.Constants.PROD_BEAN_NAME)
class ProdBean {
}

4
spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java

@ -49,12 +49,12 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; @@ -49,12 +49,12 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
class MethodInvocationProceedingJoinPointTests {
@Test
void testingBindingWithJoinPoint() {
void bindingWithJoinPoint() {
assertThatIllegalStateException().isThrownBy(AbstractAspectJAdvice::currentJoinPoint);
}
@Test
void testingBindingWithProceedingJoinPoint() {
void bindingWithProceedingJoinPoint() {
assertThatIllegalStateException().isThrownBy(AbstractAspectJAdvice::currentJoinPoint);
}

2
spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJNamespaceHandlerTests.java

@ -47,7 +47,7 @@ class AspectJNamespaceHandlerTests { @@ -47,7 +47,7 @@ class AspectJNamespaceHandlerTests {
@BeforeEach
public void setUp() {
void setUp() {
SourceExtractor sourceExtractor = new PassThroughSourceExtractor();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.registry);
XmlReaderContext readerContext =

19
spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java

@ -33,6 +33,7 @@ import org.springframework.aop.aspectj.AspectJExpressionPointcut; @@ -33,6 +33,7 @@ import org.springframework.aop.aspectj.AspectJExpressionPointcut;
import org.springframework.aop.aspectj.AspectJMethodBeforeAdvice;
import org.springframework.aop.aspectj.AspectJPointcutAdvisor;
import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.util.ClassUtils;
import static org.assertj.core.api.Assertions.assertThat;
@ -48,18 +49,15 @@ class AspectJPrecedenceComparatorTests { @@ -48,18 +49,15 @@ class AspectJPrecedenceComparatorTests {
private static final int LATE_ADVICE_DECLARATION_ORDER = 10;
private AspectJPrecedenceComparator comparator;
private final AspectJPrecedenceComparator comparator = new AspectJPrecedenceComparator();
private Method anyOldMethod;
private final Method anyOldMethod = ClassUtils.getMethod(MessageService.class, "getMessage");
private AspectJExpressionPointcut anyOldPointcut;
private final AspectJExpressionPointcut anyOldPointcut = new AspectJExpressionPointcut();
@BeforeEach
public void setUp() {
this.comparator = new AspectJPrecedenceComparator();
this.anyOldMethod = getClass().getMethods()[0];
this.anyOldPointcut = new AspectJExpressionPointcut();
void setUp() {
this.anyOldPointcut.setExpression("execution(* *(..))");
}
@ -209,4 +207,11 @@ class AspectJPrecedenceComparatorTests { @@ -209,4 +207,11 @@ class AspectJPrecedenceComparatorTests {
return advisor;
}
static class MessageService {
public String getMessage() {
return "test";
}
}
}

4
spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java

@ -48,7 +48,7 @@ class HotSwappableTargetSourceTests { @@ -48,7 +48,7 @@ class HotSwappableTargetSourceTests {
@BeforeEach
public void setup() {
void setup() {
this.beanFactory = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(
qualifiedResource(HotSwappableTargetSourceTests.class, "context.xml"));
@ -58,7 +58,7 @@ class HotSwappableTargetSourceTests { @@ -58,7 +58,7 @@ class HotSwappableTargetSourceTests {
* We must simulate container shutdown, which should clear threads.
*/
@AfterEach
public void close() {
void close() {
// Will call pool.close()
this.beanFactory.destroySingletons();
}

2
spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java

@ -39,7 +39,7 @@ class PrototypeTargetSourceTests { @@ -39,7 +39,7 @@ class PrototypeTargetSourceTests {
@BeforeEach
public void setup() {
void setup() {
this.beanFactory = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(
qualifiedResource(PrototypeTargetSourceTests.class, "context.xml"));

2
spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java

@ -40,7 +40,7 @@ class ThreadLocalTargetSourceTests { @@ -40,7 +40,7 @@ class ThreadLocalTargetSourceTests {
@BeforeEach
public void setup() {
void setup() {
this.beanFactory = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(this.beanFactory).loadBeanDefinitions(
qualifiedResource(ThreadLocalTargetSourceTests.class, "context.xml"));

4
spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java

@ -46,7 +46,7 @@ import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING; @@ -46,7 +46,7 @@ import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
* @author Stephane Nicoll
*/
@EnabledForTestGroups(LONG_RUNNING)
public class AnnotationAsyncExecutionAspectTests {
class AnnotationAsyncExecutionAspectTests {
private static final long WAIT_TIME = 1000; //milliseconds
@ -56,7 +56,7 @@ public class AnnotationAsyncExecutionAspectTests { @@ -56,7 +56,7 @@ public class AnnotationAsyncExecutionAspectTests {
@BeforeEach
public void setUp() {
void setUp() {
executor = new CountingExecutor();
AnnotationAsyncExecutionAspect.aspectOf().setExecutor(executor);
}

4
spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationDrivenBeanDefinitionParserTests.java

@ -37,13 +37,13 @@ class AnnotationDrivenBeanDefinitionParserTests { @@ -37,13 +37,13 @@ class AnnotationDrivenBeanDefinitionParserTests {
private ConfigurableApplicationContext context;
@BeforeEach
public void setup() {
void setup() {
this.context = new ClassPathXmlApplicationContext(
"annotationDrivenContext.xml", AnnotationDrivenBeanDefinitionParserTests.class);
}
@AfterEach
public void after() {
void after() {
if (this.context != null) {
this.context.close();
}

4
spring-aspects/src/test/java/org/springframework/transaction/aspectj/JtaTransactionAspectsTests.java

@ -36,13 +36,13 @@ import static org.assertj.core.api.Assertions.assertThatIOException; @@ -36,13 +36,13 @@ import static org.assertj.core.api.Assertions.assertThatIOException;
* @author Stephane Nicoll
*/
@SpringJUnitConfig(JtaTransactionAspectsTests.Config.class)
public class JtaTransactionAspectsTests {
class JtaTransactionAspectsTests {
@Autowired
private CallCountingTransactionManager txManager;
@BeforeEach
public void setUp() {
void setUp() {
this.txManager.clear();
}

2
spring-beans/src/test/java/org/springframework/beans/factory/CustomObjectProviderTests.java

@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
* @author Juergen Hoeller
* @since 6.2
*/
public class CustomObjectProviderTests {
class CustomObjectProviderTests {
@Test
void getObject() {

2
spring-beans/src/test/java/org/springframework/beans/factory/support/BeanRegistryAdapterTests.java

@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Sebastien Deleuze
*/
public class BeanRegistryAdapterTests {
class BeanRegistryAdapterTests {
private final DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();

2
spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Juergen Hoeller
*/
@SuppressWarnings("resource")
public class BeanMethodPolymorphismTests {
class BeanMethodPolymorphismTests {
@Test
void beanMethodDetectedOnSuperClass() {

8
spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAndImportAnnotationInteractionTests.java

@ -28,7 +28,7 @@ import org.springframework.context.annotation.componentscan.simple.SimpleCompone @@ -28,7 +28,7 @@ import org.springframework.context.annotation.componentscan.simple.SimpleCompone
* @author Chris Beams
* @since 3.1
*/
public class ComponentScanAndImportAnnotationInteractionTests {
class ComponentScanAndImportAnnotationInteractionTests {
@Test
void componentScanOverlapsWithImport() {
@ -101,10 +101,4 @@ public class ComponentScanAndImportAnnotationInteractionTests { @@ -101,10 +101,4 @@ public class ComponentScanAndImportAnnotationInteractionTests {
static final class Config3 {
}
@ComponentScan("org.springframework.context.annotation.componentscan.simple")
@ComponentScan("org.springframework.context.annotation.componentscan.importing")
public static final class ImportedConfig {
}
}

4
spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorAotContributionTests.java

@ -83,7 +83,7 @@ import static org.assertj.core.api.Assertions.entry; @@ -83,7 +83,7 @@ import static org.assertj.core.api.Assertions.entry;
* @author Sam Brannen
* @author Sebastien Deleuze
*/
public class ConfigurationClassPostProcessorAotContributionTests {
class ConfigurationClassPostProcessorAotContributionTests {
private final TestGenerationContext generationContext = new TestGenerationContext();
@ -466,7 +466,7 @@ public class ConfigurationClassPostProcessorAotContributionTests { @@ -466,7 +466,7 @@ public class ConfigurationClassPostProcessorAotContributionTests {
}
@Nested
public class BeanRegistrarTests {
class BeanRegistrarTests {
@Test
void applyToWhenHasDefaultConstructor() throws NoSuchMethodException {

2
spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassWithConditionTests.java

@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Juergen Hoeller
*/
@SuppressWarnings("resource")
public class ConfigurationClassWithConditionTests {
class ConfigurationClassWithConditionTests {
@Test
void conditionalOnMissingBeanMatch() {

2
spring-context/src/test/java/org/springframework/context/annotation/Gh23206Tests.java

@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
*
* @author Stephane Nicoll
*/
public class Gh23206Tests {
class Gh23206Tests {
@Test
void componentScanShouldFailWithRegisterBeanCondition() {

2
spring-context/src/test/java/org/springframework/context/annotation/Gh32489Tests.java

@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Stephane Nicoll
*/
public class Gh32489Tests {
class Gh32489Tests {
@Test
void resolveFactoryBeansWithWildcard() {

2
spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java

@ -64,7 +64,7 @@ import static org.mockito.Mockito.spy; @@ -64,7 +64,7 @@ import static org.mockito.Mockito.spy;
* @author Stephane Nicoll
*/
@SuppressWarnings("resource")
public class ImportSelectorTests {
class ImportSelectorTests {
static Map<Class<?>, String> importFrom = new HashMap<>();

22
spring-context/src/test/java/org/springframework/context/annotation/ImportedConfig.java

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.context.annotation;
@ComponentScan("org.springframework.context.annotation.componentscan.simple")
@ComponentScan("org.springframework.context.annotation.componentscan.importing")
public final class ImportedConfig {
}

2
spring-context/src/test/java/org/springframework/context/annotation/Spr8954Tests.java

@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Oliver Gierke
*/
@SuppressWarnings("resource")
public class Spr8954Tests {
class Spr8954Tests {
@Test
void repro() {

2
spring-context/src/test/java/org/springframework/context/annotation/beanregistrar/BeanRegistrarConfigurationTests.java

@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
*
* @author Sebastien Deleuze
*/
public class BeanRegistrarConfigurationTests {
class BeanRegistrarConfigurationTests {
@Test
void beanRegistrar() {

4
spring-context/src/test/java/org/springframework/context/annotation/componentscan/importing/ImportingConfig.java

@ -16,11 +16,11 @@ @@ -16,11 +16,11 @@
package org.springframework.context.annotation.componentscan.importing;
import org.springframework.context.annotation.ComponentScanAndImportAnnotationInteractionTests;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportedConfig;
@Configuration
@Import(ComponentScanAndImportAnnotationInteractionTests.ImportedConfig.class)
@Import(ImportedConfig.class)
public class ImportingConfig {
}

20
spring-context/src/test/java/org/springframework/context/annotation/configuration/Bar.java

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.context.annotation.configuration;
public class Bar {
}

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java

@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @since 3.1
*/
@SuppressWarnings("resource")
public class ImportAnnotationDetectionTests {
class ImportAnnotationDetectionTests {
@Test
void multipleMetaImportsAreProcessed() {

5
spring-context/src/test/java/org/springframework/context/annotation/configuration/PackagePrivateBeanMethodInheritanceTests.java

@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Chris Beams
*/
public class PackagePrivateBeanMethodInheritanceTests {
class PackagePrivateBeanMethodInheritanceTests {
@Test
void repro() {
@ -64,9 +64,6 @@ public class PackagePrivateBeanMethodInheritanceTests { @@ -64,9 +64,6 @@ public class PackagePrivateBeanMethodInheritanceTests {
}
}
public static class Bar {
}
@Configuration
public static class ReproConfig extends org.springframework.context.annotation.configuration.a.BaseConfig {
@Bean

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/a/BaseConfig.java

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
package org.springframework.context.annotation.configuration.a;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.configuration.PackagePrivateBeanMethodInheritanceTests.Bar;
import org.springframework.context.annotation.configuration.Bar;
public abstract class BaseConfig {

25
spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/MarkerAnnotation.java

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.context.annotation.configuration.spr9031;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface MarkerAnnotation {
}

8
spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/Spr9031Tests.java

@ -16,9 +16,6 @@ @@ -16,9 +16,6 @@
package org.springframework.context.annotation.configuration.spr9031;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -37,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Chris Beams
* @since 3.1.1
*/
public class Spr9031Tests {
class Spr9031Tests {
/**
* Use of @Import to register LowLevelConfig results in ASM-based annotation
@ -76,7 +73,4 @@ public class Spr9031Tests { @@ -76,7 +73,4 @@ public class Spr9031Tests {
@Autowired Spr9031Component scanned;
}
@Retention(RetentionPolicy.RUNTIME)
public @interface MarkerAnnotation {}
}

2
spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/scanpackage/Spr9031Component.java

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
package org.springframework.context.annotation.configuration.spr9031.scanpackage;
import org.springframework.context.annotation.configuration.spr9031.Spr9031Tests.MarkerAnnotation;
import org.springframework.context.annotation.configuration.spr9031.MarkerAnnotation;
@MarkerAnnotation
public class Spr9031Component {

2
spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java

@ -61,7 +61,7 @@ public abstract class AbstractMBeanServerTests { @@ -61,7 +61,7 @@ public abstract class AbstractMBeanServerTests {
@BeforeEach
public final void setUp() throws Exception {
protected final void setUp() throws Exception {
this.server = MBeanServerFactory.createMBeanServer();
try {
onSetUp();

2
spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java

@ -39,7 +39,7 @@ import static org.assertj.core.api.InstanceOfAssertFactories.type; @@ -39,7 +39,7 @@ import static org.assertj.core.api.InstanceOfAssertFactories.type;
* @author Chris Beams
*/
@SuppressWarnings("unchecked")
public class ScheduledTasksBeanDefinitionParserTests {
class ScheduledTasksBeanDefinitionParserTests {
private ApplicationContext context;

2
spring-context/src/test/java/org/springframework/scripting/config/ScriptingDefaultsTests.java

@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Dave Syer
*/
@SuppressWarnings("resource")
public class ScriptingDefaultsTests {
class ScriptingDefaultsTests {
private static final String CONFIG =
"org/springframework/scripting/config/scriptingDefaultsTests.xml";

2
spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java

@ -63,7 +63,7 @@ import static org.mockito.Mockito.mock; @@ -63,7 +63,7 @@ import static org.mockito.Mockito.mock;
* @author Chris Beams
*/
@SuppressWarnings("resource")
public class GroovyScriptFactoryTests {
class GroovyScriptFactoryTests {
@Test
void staticScript() {

12
spring-context/src/testFixtures/java/org/springframework/context/testfixture/cache/AbstractCacheAnnotationTests.java vendored

@ -19,7 +19,7 @@ package org.springframework.context.testfixture.cache; @@ -19,7 +19,7 @@ package org.springframework.context.testfixture.cache;
import java.util.Collection;
import java.util.UUID;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.AutoClose;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@ -46,6 +46,7 @@ import static org.assertj.core.api.Assertions.assertThatIOException; @@ -46,6 +46,7 @@ import static org.assertj.core.api.Assertions.assertThatIOException;
*/
public abstract class AbstractCacheAnnotationTests {
@AutoClose
protected ConfigurableApplicationContext ctx;
protected CacheableService<?> cs;
@ -62,7 +63,7 @@ public abstract class AbstractCacheAnnotationTests { @@ -62,7 +63,7 @@ public abstract class AbstractCacheAnnotationTests {
@BeforeEach
public void setup() {
void setup() {
this.ctx = getApplicationContext();
this.cs = ctx.getBean("service", CacheableService.class);
this.ccs = ctx.getBean("classService", CacheableService.class);
@ -72,13 +73,6 @@ public abstract class AbstractCacheAnnotationTests { @@ -72,13 +73,6 @@ public abstract class AbstractCacheAnnotationTests {
assertThat(cn).containsOnly("testCache", "secondary", "primary");
}
@AfterEach
public void close() {
if (this.ctx != null) {
this.ctx.close();
}
}
protected void testCacheable(CacheableService<?> service) {
Object o1 = new Object();

2
spring-core-test/src/test/java/org/springframework/aot/agent/InstrumentedMethodTests.java

@ -109,7 +109,7 @@ class InstrumentedMethodTests { @@ -109,7 +109,7 @@ class InstrumentedMethodTests {
.onInstance(String.class).returnValue(String.class.getDeclaredConstructors()).build();
@BeforeEach
public void setup() throws Exception {
void setup() throws Exception {
this.stringGetConstructor = RecordedInvocation.of(InstrumentedMethod.CLASS_GETCONSTRUCTOR)
.onInstance(String.class).withArgument(new Class[0]).returnValue(String.class.getConstructor()).build();
this.stringGetDeclaredConstructor = RecordedInvocation.of(InstrumentedMethod.CLASS_GETDECLAREDCONSTRUCTOR)

2
spring-core/src/test/java/org/springframework/core/NullnessTests.java

@ -31,7 +31,7 @@ import org.springframework.core.testfixture.nullness.marked.unmarked.PackageUnma @@ -31,7 +31,7 @@ import org.springframework.core.testfixture.nullness.marked.unmarked.PackageUnma
*
* @author Sebastien Deleuze
*/
public class NullnessTests {
class NullnessTests {
// JSpecify without @NullMarked and @NullUnmarked

2
spring-core/src/test/java/org/springframework/core/io/buffer/JettyDataBufferTests.java

@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; @@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Arjen Poutsma
* @author Brian Clozel
*/
public class JettyDataBufferTests {
class JettyDataBufferTests {
private final JettyDataBufferFactory dataBufferFactory = new JettyDataBufferFactory();

8
spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java

@ -660,9 +660,8 @@ class ClassUtilsTests { @@ -660,9 +660,8 @@ class ClassUtilsTests {
}
@Test
// This method is intentionally public.
public void publicMethodInNonPublicClass(TestInfo testInfo) {
Method originalMethod = testInfo.getTestMethod().get();
void publicMethodInNonPublicClass() throws Exception {
Method originalMethod = getClass().getMethod("publicMethod");
// Prerequisites for this use case:
assertPublic(originalMethod);
@ -673,6 +672,9 @@ class ClassUtilsTests { @@ -673,6 +672,9 @@ class ClassUtilsTests {
assertNotPubliclyAccessible(publiclyAccessibleMethod);
}
public void publicMethod() {
}
@Test
void publicMethodInNonPublicInterface() throws Exception {
Class<?> originalType = PrivateInterface.class;

2
spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java

@ -162,7 +162,7 @@ public abstract class AbstractDataBufferAllocatingTests { @@ -162,7 +162,7 @@ public abstract class AbstractDataBufferAllocatingTests {
@BeforeAll
@SuppressWarnings("deprecation") // PooledByteBufAllocator no longer supports tinyCacheSize.
public static void createAllocators() {
static void createAllocators() {
netty4OnHeapUnpooled = new UnpooledByteBufAllocator(false);
netty4OffHeapUnpooled = new UnpooledByteBufAllocator(true);
netty4OnHeapPooled = new PooledByteBufAllocator(false, 1, 1, 4096, 4, 0, 0, 0, true);

2
spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationPerformanceTests.java

@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.fail; @@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.fail;
* @since 4.1
*/
@Disabled
public class SpelCompilationPerformanceTests extends AbstractExpressionTests {
class SpelCompilationPerformanceTests extends AbstractExpressionTests {
int count = 50000; // number of evaluations that are timed in one run

2
spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java

@ -829,7 +829,7 @@ class JdbcTemplateTests { @@ -829,7 +829,7 @@ class JdbcTemplateTests {
}));
}
void test3BatchesOf2ItemsFailing(Consumer<Exception> exception) throws Exception {
private void test3BatchesOf2ItemsFailing(Consumer<Exception> exception) throws Exception {
String sql = "INSERT INTO NOSUCHTABLE values (?)";
List<Integer> ids = Arrays.asList(1, 2, 3, 2, 4, 5);
int[] rowsAffected = new int[] {1, 1};

2
spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/HeaderMethodArgumentResolverTests.java

@ -53,7 +53,7 @@ class HeaderMethodArgumentResolverTests { @@ -53,7 +53,7 @@ class HeaderMethodArgumentResolverTests {
@BeforeEach
public void setup() {
void setup() {
GenericApplicationContext context = new GenericApplicationContext();
context.refresh();
this.resolver = new HeaderMethodArgumentResolver(new DefaultConversionService(), context.getBeanFactory());

2
spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/MessageMappingMessageHandlerTests.java

@ -59,7 +59,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -59,7 +59,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Rossen Stoyanchev
*/
@SuppressWarnings("ALL")
public class MessageMappingMessageHandlerTests {
class MessageMappingMessageHandlerTests {
private TestEncoderMethodReturnValueHandler returnValueHandler;

2
spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolverTests.java

@ -54,7 +54,7 @@ class HeaderMethodArgumentResolverTests { @@ -54,7 +54,7 @@ class HeaderMethodArgumentResolverTests {
@BeforeEach
public void setup() {
void setup() {
GenericApplicationContext context = new GenericApplicationContext();
context.refresh();
this.resolver = new HeaderMethodArgumentResolver(new DefaultConversionService(), context.getBeanFactory());

2
spring-messaging/src/test/java/org/springframework/messaging/rsocket/RSocketClientToServerIntegrationTests.java

@ -74,7 +74,7 @@ class RSocketClientToServerIntegrationTests { @@ -74,7 +74,7 @@ class RSocketClientToServerIntegrationTests {
@BeforeAll
@SuppressWarnings("ConstantConditions")
public static void setupOnce() {
static void setupOnce() {
MimeType metadataMimeType = MimeTypeUtils.parseMimeType(
WellKnownMimeType.MESSAGE_RSOCKET_COMPOSITE_METADATA.getString());

2
spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandlerTests.java

@ -71,7 +71,7 @@ import static org.mockito.Mockito.verify; @@ -71,7 +71,7 @@ import static org.mockito.Mockito.verify;
* @author Stephane Nicoll
*/
@ExtendWith(MockitoExtension.class)
public class SendToMethodReturnValueHandlerTests {
class SendToMethodReturnValueHandlerTests {
private static final MimeType MIME_TYPE = new MimeType("text", "plain", StandardCharsets.UTF_8);

2
spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerTests.java

@ -79,7 +79,7 @@ import static org.mockito.Mockito.verify; @@ -79,7 +79,7 @@ import static org.mockito.Mockito.verify;
* @author Sebastien Deleuze
*/
@ExtendWith(MockitoExtension.class)
public class SimpAnnotationMethodMessageHandlerTests {
class SimpAnnotationMethodMessageHandlerTests {
private static final String TEST_INVALID_VALUE = "invalidValue";

2
spring-messaging/src/test/java/org/springframework/messaging/simp/broker/SimpleBrokerMessageHandlerTests.java

@ -60,7 +60,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; @@ -60,7 +60,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
*/
@ExtendWith(MockitoExtension.class)
@SuppressWarnings("unchecked")
public class SimpleBrokerMessageHandlerTests {
class SimpleBrokerMessageHandlerTests {
private SimpleBrokerMessageHandler messageHandler;

2
spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/DefaultStompSessionTests.java

@ -66,7 +66,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; @@ -66,7 +66,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
* @author Rossen Stoyanchev
*/
@MockitoSettings(strictness = Strictness.LENIENT)
public class DefaultStompSessionTests {
class DefaultStompSessionTests {
private DefaultStompSession session;

4
spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/SplittingStompEncoderTests.java

@ -32,11 +32,11 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -32,11 +32,11 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
* @author Injae Kim
* @author Rossen Stoyanchev
*/
public class SplittingStompEncoderTests {
class SplittingStompEncoderTests {
private static final StompEncoder ENCODER = new StompEncoder();
public static final byte[] EMPTY_PAYLOAD = new byte[0];
private static final byte[] EMPTY_PAYLOAD = new byte[0];
@Test

2
spring-messaging/src/test/java/org/springframework/messaging/support/ExecutorSubscribableChannelTests.java

@ -47,7 +47,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; @@ -47,7 +47,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
* @author Phillip Webb
*/
@ExtendWith(MockitoExtension.class)
public class ExecutorSubscribableChannelTests {
class ExecutorSubscribableChannelTests {
private ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel();

2
spring-oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTests.java

@ -57,7 +57,7 @@ public abstract class AbstractMarshallerTests<M extends Marshaller> { @@ -57,7 +57,7 @@ public abstract class AbstractMarshallerTests<M extends Marshaller> {
protected Object flights;
@BeforeEach
public final void setUp() throws Exception {
final void setUp() throws Exception {
marshaller = createMarshaller();
flights = createFlights();
}

2
spring-oxm/src/test/java/org/springframework/oxm/AbstractUnmarshallerTests.java

@ -59,7 +59,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> { @@ -59,7 +59,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
"<tns:flight><tns:number>42</tns:number></tns:flight></tns:flights>";
@BeforeEach
public final void setUp() throws Exception {
final void setUp() throws Exception {
unmarshaller = createUnmarshaller();
}

2
spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/init/ScriptUtilsTests.java

@ -216,7 +216,7 @@ class ScriptUtilsTests { @@ -216,7 +216,7 @@ class ScriptUtilsTests {
~/* double " quotes */\n insert into colors(color_num) values(42);~ | ; | true
~/* double \\" quotes */\n insert into colors(color_num) values(42);~ | ; | true
""")
public void containsStatementSeparator(String script, String delimiter, boolean expected) {
void containsStatementSeparator(String script, String delimiter, boolean expected) {
boolean contains = ScriptUtils.containsStatementSeparator(null, script, delimiter,
DEFAULT_COMMENT_PREFIXES, DEFAULT_BLOCK_COMMENT_START_DELIMITER, DEFAULT_BLOCK_COMMENT_END_DELIMITER);

2
spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/lookup/BeanFactoryConnectionFactoryLookupTests.java

@ -37,7 +37,7 @@ import static org.mockito.Mockito.when; @@ -37,7 +37,7 @@ import static org.mockito.Mockito.when;
* @author Mark Paluch
*/
@ExtendWith(MockitoExtension.class)
public class BeanFactoryConnectionFactoryLookupTests {
class BeanFactoryConnectionFactoryLookupTests {
private static final String CONNECTION_FACTORY_BEAN_NAME = "connectionFactory";

2
spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractDatabaseClientIntegrationTests.java

@ -47,7 +47,7 @@ abstract class AbstractDatabaseClientIntegrationTests { @@ -47,7 +47,7 @@ abstract class AbstractDatabaseClientIntegrationTests {
@BeforeEach
public void before() {
protected void before() {
connectionFactory = createConnectionFactory();
Mono.from(connectionFactory.create())

10
spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractTransactionalDatabaseClientIntegrationTests.java

@ -19,7 +19,7 @@ package org.springframework.r2dbc.core; @@ -19,7 +19,7 @@ package org.springframework.r2dbc.core;
import io.r2dbc.spi.ConnectionFactory;
import io.r2dbc.spi.Result;
import org.assertj.core.api.Condition;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.AutoClose;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;
@ -48,6 +48,7 @@ abstract class AbstractTransactionalDatabaseClientIntegrationTests { @@ -48,6 +48,7 @@ abstract class AbstractTransactionalDatabaseClientIntegrationTests {
private ConnectionFactory connectionFactory;
@AutoClose
AnnotationConfigApplicationContext context;
DatabaseClient databaseClient;
@ -58,7 +59,7 @@ abstract class AbstractTransactionalDatabaseClientIntegrationTests { @@ -58,7 +59,7 @@ abstract class AbstractTransactionalDatabaseClientIntegrationTests {
@BeforeEach
public void before() {
void before() {
connectionFactory = createConnectionFactory();
context = new AnnotationConfigApplicationContext();
@ -78,11 +79,6 @@ abstract class AbstractTransactionalDatabaseClientIntegrationTests { @@ -78,11 +79,6 @@ abstract class AbstractTransactionalDatabaseClientIntegrationTests {
rxtx = TransactionalOperator.create(transactionManager);
}
@AfterEach
public void tearDown() {
context.close();
}
/**
* Create a {@link ConnectionFactory} to be used in this test.

2
spring-r2dbc/src/test/java/org/springframework/r2dbc/core/H2DatabaseClientContextIntegrationTests.java

@ -45,7 +45,7 @@ class H2DatabaseClientContextIntegrationTests extends H2DatabaseClientIntegratio @@ -45,7 +45,7 @@ class H2DatabaseClientContextIntegrationTests extends H2DatabaseClientIntegratio
}
@AfterEach
public void tearDown() {
void tearDown() {
context.close();
assertThatExceptionOfType(R2dbcNonTransientResourceException.class).isThrownBy(
() -> connectionFactory.create().block());

2
spring-test/src/test/java/org/springframework/test/context/cache/ContextCacheTestSuite.java vendored

@ -52,5 +52,5 @@ import org.junit.platform.suite.api.Suite; @@ -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 {
}

2
spring-test/src/test/java/org/springframework/test/context/config/ContextConfigTestSuite.java

@ -50,5 +50,5 @@ import org.junit.platform.suite.api.Suite; @@ -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 {
}

4
spring-test/src/test/java/org/springframework/test/context/event/CustomTestEventTests.java

@ -45,13 +45,13 @@ import static org.springframework.test.context.TestExecutionListeners.MergeMode. @@ -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();
}

4
spring-test/src/test/java/org/springframework/test/context/event/EventPublishingTestExecutionListenerIntegrationTests.java

@ -66,7 +66,7 @@ import static org.mockito.Mockito.verify; @@ -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 { @@ -88,7 +88,7 @@ public class EventPublishingTestExecutionListenerIntegrationTests {
@AfterEach
public void closeApplicationContext() {
void closeApplicationContext() {
this.testContext.markApplicationContextDirty(null);
}

2
spring-test/src/test/java/org/springframework/test/context/hierarchies/web/DispatcherWacRootWacEarTests.java

@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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;

2
spring-test/src/test/java/org/springframework/test/context/initializers/AciTestSuite.java

@ -58,5 +58,5 @@ import org.springframework.context.ApplicationContextInitializer; @@ -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 {
}

2
spring-test/src/test/java/org/springframework/test/context/initializers/annotation/InitializerConfiguredViaMetaAnnotationTests.java

@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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;

2
spring-test/src/test/java/org/springframework/test/context/initializers/annotation/InitializerWithoutConfigFilesOrClassesTests.java

@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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;

2
spring-test/src/test/java/org/springframework/test/context/initializers/annotation/MergedInitializersAnnotationConfigTests.java

@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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

2
spring-test/src/test/java/org/springframework/test/context/initializers/annotation/MultipleInitializersAnnotationConfigTests.java

@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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;

2
spring-test/src/test/java/org/springframework/test/context/initializers/annotation/OrderedInitializersAnnotationConfigTests.java

@ -50,7 +50,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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";

2
spring-test/src/test/java/org/springframework/test/context/initializers/annotation/OverriddenInitializersAnnotationConfigTests.java

@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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

2
spring-test/src/test/java/org/springframework/test/context/initializers/annotation/PropertySourcesInitializerTests.java

@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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 {

2
spring-test/src/test/java/org/springframework/test/context/initializers/annotation/SingleInitializerAnnotationConfigTests.java

@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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;

2
spring-test/src/test/java/org/springframework/test/context/initializers/xml/MultipleInitializersXmlConfigTests.java

@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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;

2
spring-test/src/test/java/org/springframework/test/context/junit/SpringJUnitJupiterTestSuite.java

@ -46,5 +46,5 @@ import org.junit.platform.suite.api.Suite; @@ -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 {
}

3
spring-test/src/test/java/org/springframework/test/context/profile/importresource/DevProfileResolverAnnotationConfigTests.java

@ -24,11 +24,12 @@ import org.springframework.test.context.ActiveProfilesResolver; @@ -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" };
}
}

2
spring-test/src/test/java/org/springframework/test/util/ExceptionCollectorTests.java

@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThatNoException; @@ -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';

2
spring-test/src/test/java/org/springframework/test/web/client/match/ContentRequestMatchersTests.java

@ -37,7 +37,7 @@ import static org.hamcrest.Matchers.hasXPath; @@ -37,7 +37,7 @@ import static org.hamcrest.Matchers.hasXPath;
*
* @author Rossen Stoyanchev
*/
public class ContentRequestMatchersTests {
class ContentRequestMatchersTests {
private final MockClientHttpRequest request = new MockClientHttpRequest();

2
spring-test/src/test/java/org/springframework/test/web/client/match/JsonPathRequestMatchersTests.java

@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.equalTo; @@ -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', " + //

4
spring-test/src/test/java/org/springframework/test/web/client/match/MultipartRequestMatchersTests.java

@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -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 { @@ -54,7 +54,7 @@ public class MultipartRequestMatchersTests {
@BeforeEach
public void setup() {
void setup() {
this.request.getHeaders().setContentType(MediaType.MULTIPART_FORM_DATA);
}

4
spring-test/src/test/java/org/springframework/test/web/client/match/XpathRequestMatchersTests.java

@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -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 { @@ -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());
}

4
spring-test/src/test/java/org/springframework/test/web/client/samples/matchers/XpathRequestMatchersIntegrationTests.java

@ -53,7 +53,7 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat @@ -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 { @@ -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),

3
spring-test/src/test/java/org/springframework/test/web/reactive/server/ApplicationContextSpecTests.java

@ -34,8 +34,7 @@ import org.springframework.web.server.session.WebSessionManager; @@ -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() {

2
spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java

@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Rossen Stoyanchev
*/
public class DefaultControllerSpecTests {
class DefaultControllerSpecTests {
@Test
void controller() {

2
spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultRouterFunctionSpecTests.java

@ -30,7 +30,7 @@ import org.springframework.web.reactive.function.server.ServerResponse; @@ -30,7 +30,7 @@ import org.springframework.web.reactive.function.server.ServerResponse;
*
* @author Rossen Stoyanchev
*/
public class DefaultRouterFunctionSpecTests {
class DefaultRouterFunctionSpecTests {
@Test
void webFilter() {

2
spring-test/src/test/java/org/springframework/test/web/reactive/server/HttpHandlerConnectorTests.java

@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Rossen Stoyanchev
*/
public class HttpHandlerConnectorTests {
class HttpHandlerConnectorTests {
@Test
void adaptRequest() {

2
spring-test/src/test/java/org/springframework/test/web/reactive/server/MockServerSpecTests.java

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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();

3
spring-test/src/test/java/org/springframework/test/web/reactive/server/MockServerTests.java

@ -37,8 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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() {

2
spring-test/src/test/java/org/springframework/test/web/reactive/server/WiretapConnectorTests.java

@ -50,7 +50,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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));

2
spring-test/src/test/java/org/springframework/test/web/reactive/server/assertj/WebTestClientResponseTests.java

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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();

2
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/ApiVersionTests.java

@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Rossen Stoyanchev
*/
public class ApiVersionTests {
class ApiVersionTests {
@Test
void header() {

2
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/GlobalEntityResultConsumerTests.java

@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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();

4
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/ControllerTests.java

@ -29,13 +29,13 @@ import org.springframework.web.bind.annotation.RestController; @@ -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();
}

6
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/HttpServerTests.java

@ -35,7 +35,7 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r @@ -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 { @@ -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 { @@ -58,7 +58,7 @@ public class HttpServerTests {
}
@AfterEach
public void stop() {
void stop() {
this.server.stop();
}

4
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/RouterFunctionTests.java

@ -32,13 +32,13 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r @@ -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!"));

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save