From 1256307c83efcc74c2084bf8f6031fbe7fc3648d Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Tue, 17 Mar 2026 12:40:52 +0100 Subject: [PATCH] Enable SpringJUnit5 Checkstyle rule See gh-36496 Closes gh-36496 --- .../springframework/core/env/Constants.java | 36 ++++++++++++++++ .../EnvironmentSystemIntegrationTests.java | 42 +++++-------------- .../core/env/scan1/DevConfig.java | 2 +- .../core/env/scan1/ProdConfig.java | 2 +- .../core/env/scan2/DevBean.java | 4 +- .../core/env/scan2/ProdBean.java | 4 +- ...hodInvocationProceedingJoinPointTests.java | 4 +- .../AspectJNamespaceHandlerTests.java | 2 +- .../AspectJPrecedenceComparatorTests.java | 19 +++++---- .../target/HotSwappableTargetSourceTests.java | 4 +- .../target/PrototypeTargetSourceTests.java | 2 +- .../target/ThreadLocalTargetSourceTests.java | 2 +- .../AnnotationAsyncExecutionAspectTests.java | 4 +- ...tationDrivenBeanDefinitionParserTests.java | 4 +- .../aspectj/JtaTransactionAspectsTests.java | 4 +- .../factory/CustomObjectProviderTests.java | 2 +- .../support/BeanRegistryAdapterTests.java | 2 +- .../BeanMethodPolymorphismTests.java | 2 +- ...anAndImportAnnotationInteractionTests.java | 8 +--- ...lassPostProcessorAotContributionTests.java | 4 +- .../ConfigurationClassWithConditionTests.java | 2 +- .../context/annotation/Gh23206Tests.java | 2 +- .../context/annotation/Gh32489Tests.java | 2 +- .../annotation/ImportSelectorTests.java | 2 +- .../context/annotation/ImportedConfig.java | 22 ++++++++++ .../context/annotation/Spr8954Tests.java | 2 +- .../BeanRegistrarConfigurationTests.java | 2 +- .../importing/ImportingConfig.java | 4 +- .../context/annotation/configuration/Bar.java | 20 +++++++++ .../ImportAnnotationDetectionTests.java | 2 +- ...kagePrivateBeanMethodInheritanceTests.java | 5 +-- .../configuration/a/BaseConfig.java | 2 +- .../spr9031/MarkerAnnotation.java | 25 +++++++++++ .../configuration/spr9031/Spr9031Tests.java | 8 +--- .../spr9031/scanpackage/Spr9031Component.java | 2 +- .../jmx/AbstractMBeanServerTests.java | 2 +- ...heduledTasksBeanDefinitionParserTests.java | 2 +- .../config/ScriptingDefaultsTests.java | 2 +- .../groovy/GroovyScriptFactoryTests.java | 2 +- .../cache/AbstractCacheAnnotationTests.java | 12 ++---- .../aot/agent/InstrumentedMethodTests.java | 2 +- .../springframework/core/NullnessTests.java | 2 +- .../core/io/buffer/JettyDataBufferTests.java | 2 +- .../springframework/util/ClassUtilsTests.java | 8 ++-- .../AbstractDataBufferAllocatingTests.java | 2 +- .../spel/SpelCompilationPerformanceTests.java | 2 +- .../jdbc/core/JdbcTemplateTests.java | 2 +- .../HeaderMethodArgumentResolverTests.java | 2 +- .../MessageMappingMessageHandlerTests.java | 2 +- .../HeaderMethodArgumentResolverTests.java | 2 +- ...RSocketClientToServerIntegrationTests.java | 2 +- .../SendToMethodReturnValueHandlerTests.java | 2 +- ...mpAnnotationMethodMessageHandlerTests.java | 2 +- .../SimpleBrokerMessageHandlerTests.java | 2 +- .../simp/stomp/DefaultStompSessionTests.java | 2 +- .../stomp/SplittingStompEncoderTests.java | 4 +- .../ExecutorSubscribableChannelTests.java | 2 +- .../oxm/AbstractMarshallerTests.java | 2 +- .../oxm/AbstractUnmarshallerTests.java | 2 +- .../connection/init/ScriptUtilsTests.java | 2 +- ...anFactoryConnectionFactoryLookupTests.java | 2 +- ...bstractDatabaseClientIntegrationTests.java | 2 +- ...ctionalDatabaseClientIntegrationTests.java | 10 ++--- ...DatabaseClientContextIntegrationTests.java | 2 +- .../context/cache/ContextCacheTestSuite.java | 2 +- .../config/ContextConfigTestSuite.java | 2 +- .../context/event/CustomTestEventTests.java | 4 +- ...TestExecutionListenerIntegrationTests.java | 4 +- .../web/DispatcherWacRootWacEarTests.java | 2 +- .../context/initializers/AciTestSuite.java | 2 +- ...lizerConfiguredViaMetaAnnotationTests.java | 2 +- ...lizerWithoutConfigFilesOrClassesTests.java | 2 +- ...rgedInitializersAnnotationConfigTests.java | 2 +- ...ipleInitializersAnnotationConfigTests.java | 2 +- ...eredInitializersAnnotationConfigTests.java | 2 +- ...ddenInitializersAnnotationConfigTests.java | 2 +- .../PropertySourcesInitializerTests.java | 2 +- ...ingleInitializerAnnotationConfigTests.java | 2 +- .../MultipleInitializersXmlConfigTests.java | 2 +- .../junit/SpringJUnitJupiterTestSuite.java | 2 +- ...vProfileResolverAnnotationConfigTests.java | 3 +- .../test/util/ExceptionCollectorTests.java | 2 +- .../match/ContentRequestMatchersTests.java | 2 +- .../match/JsonPathRequestMatchersTests.java | 2 +- .../match/MultipartRequestMatchersTests.java | 4 +- .../match/XpathRequestMatchersTests.java | 4 +- .../XpathRequestMatchersIntegrationTests.java | 4 +- .../server/ApplicationContextSpecTests.java | 3 +- .../server/DefaultControllerSpecTests.java | 2 +- .../DefaultRouterFunctionSpecTests.java | 2 +- .../server/HttpHandlerConnectorTests.java | 2 +- .../reactive/server/MockServerSpecTests.java | 2 +- .../web/reactive/server/MockServerTests.java | 3 +- .../server/WiretapConnectorTests.java | 2 +- .../assertj/WebTestClientResponseTests.java | 2 +- .../server/samples/ApiVersionTests.java | 2 +- .../GlobalEntityResultConsumerTests.java | 2 +- .../server/samples/bind/ControllerTests.java | 4 +- .../server/samples/bind/HttpServerTests.java | 6 +-- .../samples/bind/RouterFunctionTests.java | 4 +- .../web/servlet/DefaultMvcResultTests.java | 2 +- ...AbstractHttpServletRequestAssertTests.java | 2 +- ...actMockHttpServletResponseAssertTests.java | 2 +- .../MockMvcTesterIntegrationTests.java | 2 +- .../assertj/RestTestClientResponseTests.java | 2 +- .../client/samples/ApiVersionTests.java | 2 +- .../htmlunit/HostRequestMatcherTests.java | 2 +- .../htmlunit/HtmlUnitRequestBuilderTests.java | 2 +- .../MockMvcConnectionBuilderSupportTests.java | 4 +- .../htmlunit/MockMvcWebConnectionTests.java | 2 +- .../htmlunit/MockWebResponseBuilderTests.java | 4 +- .../htmlunit/UrlRegexRequestMatcherTests.java | 2 +- ...ltipartHttpServletRequestBuilderTests.java | 2 +- ...ltipartHttpServletRequestBuilderTests.java | 2 +- .../FlashAttributeResultMatchersTests.java | 2 +- .../result/HeaderResultMatchersTests.java | 2 +- .../result/MockMvcResultMatchersTests.java | 2 +- .../result/StatusResultMatchersTests.java | 2 +- .../result/XpathResultMatchersTests.java | 2 +- .../AsyncControllerJavaConfigTests.java | 4 +- .../client/context/WebAppResourceTests.java | 4 +- .../client/context/XmlConfigTests.java | 4 +- .../client/standalone/FilterTests.java | 2 +- .../standalone/FrameworkExtensionTests.java | 2 +- .../standalone/MultipartControllerTests.java | 2 +- .../standalone/ReactiveReturnTypeTests.java | 2 +- .../client/standalone/RedirectTests.java | 2 +- .../standalone/RequestParameterTests.java | 2 +- .../samples/client/standalone/SseTests.java | 2 +- .../PrintingResultHandlerSmokeTests.java | 2 +- .../resultmatches/CookieAssertionTests.java | 4 +- .../FlashAttributeAssertionTests.java | 2 +- .../resultmatches/HandlerAssertionTests.java | 2 +- .../resultmatches/JsonPathAssertionTests.java | 2 +- .../resultmatches/ModelAssertionTests.java | 2 +- .../RequestAttributeAssertionTests.java | 2 +- .../SessionAttributeAssertionTests.java | 2 +- .../resultmatches/UrlAssertionTests.java | 2 +- .../resultmatches/ViewNameAssertionTests.java | 2 +- .../XmlContentAssertionTests.java | 2 +- .../resultmatches/XpathAssertionTests.java | 2 +- .../AsyncControllerJavaConfigTests.java | 4 +- .../samples/context/JavaConfigTests.java | 4 +- .../samples/context/WebAppResourceTests.java | 4 +- .../samples/context/XmlConfigTests.java | 4 +- ...stAttributesRequestContextHolderTests.java | 4 +- .../servlet/samples/spr/EncodedUriTests.java | 2 +- .../servlet/samples/spr/FormContentTests.java | 2 +- .../servlet/samples/spr/HttpOptionsTests.java | 2 +- .../spr/RequestContextHolderTests.java | 4 +- .../samples/standalone/ApiVersionTests.java | 2 +- .../standalone/ExceptionHandlerTests.java | 2 +- .../samples/standalone/FilterTests.java | 2 +- .../standalone/FrameworkExtensionTests.java | 2 +- .../standalone/ReactiveReturnTypeTests.java | 3 +- .../samples/standalone/RedirectTests.java | 4 +- .../standalone/RequestParameterTests.java | 3 +- .../standalone/RouterFunctionTests.java | 2 +- .../PrintingResultHandlerSmokeTests.java | 2 +- .../resultmatchers/ContentAssertionTests.java | 2 +- .../resultmatchers/CookieAssertionTests.java | 4 +- .../FlashAttributeAssertionTests.java | 2 +- .../resultmatchers/HandlerAssertionTests.java | 2 +- .../resultmatchers/HeaderAssertionTests.java | 4 +- .../JsonPathAssertionTests.java | 4 +- .../resultmatchers/ModelAssertionTests.java | 2 +- .../RequestAttributeAssertionTests.java | 2 +- .../SessionAttributeAssertionTests.java | 2 +- .../resultmatchers/UrlAssertionTests.java | 4 +- .../ViewNameAssertionTests.java | 4 +- .../XmlContentAssertionTests.java | 4 +- .../resultmatchers/XpathAssertionTests.java | 4 +- .../setup/DefaultMockMvcBuilderTests.java | 2 +- .../setup/MockMvcFilterDecoratorTests.java | 4 +- .../servlet/setup/SharedHttpSessionTests.java | 2 +- .../web/support/CookieAssertionsTests.java | 2 +- .../SimpleClientHttpRequestFactoryTests.java | 2 +- .../codec/ResourceHttpMessageWriterTests.java | 2 +- .../CustomizedJackson2JsonEncoderTests.java | 2 +- .../CustomizedJacksonJsonDecoderTests.java | 4 +- .../CustomizedJacksonJsonEncoderTests.java | 2 +- .../codec/json/Jackson2JsonDecoderTests.java | 2 +- .../protobuf/ProtobufJsonDecoderTests.java | 2 +- .../Jackson2ObjectMapperFactoryBeanTests.java | 2 +- .../ServletRequestHeadersAdapterTests.java | 2 +- .../DefaultApiVersionStrategiesTests.java | 2 +- ...MediaTypeParamApiVersionResolverTests.java | 2 +- .../accept/PathApiVersionResolverTests.java | 2 +- .../accept/QueryApiVersionResolverTests.java | 2 +- .../accept/SemanticApiVersionParserTests.java | 2 +- ...dardApiVersionDeprecationHandlerTests.java | 2 +- .../web/client/RestClientBuilderTests.java | 2 +- .../web/client/RestClientVersionTests.java | 2 +- ...stClientProxyRegistryIntegrationTests.java | 2 +- .../async/AsyncRequestNotUsableTests.java | 2 +- .../web/filter/OncePerRequestFilterTests.java | 2 +- .../web/filter/UrlHandlerFilterTests.java | 2 +- .../reactive/UrlHandlerFilterTests.java | 2 +- ...ssionValueMethodArgumentResolverTests.java | 2 +- .../invoker/HttpServiceProxyFactoryTests.java | 2 +- ...pServiceProxyRegistryFactoryBeanTests.java | 2 +- .../registry/HttpServiceRegistrarTests.java | 2 +- .../ImportHttpServiceRegistrarTests.java | 2 +- .../util/DisconnectedClientHelperTests.java | 2 +- .../reactive/DispatcherHandlerErrorTests.java | 2 +- .../DefaultApiVersionStrategiesTests.java | 2 +- ...MediaTypeParamApiVersionResolverTests.java | 2 +- .../accept/PathApiVersionResolverTests.java | 2 +- ...dardApiVersionDeprecationHandlerTests.java | 2 +- .../DelegatingWebFluxConfigurationTests.java | 2 +- .../client/DefaultWebClientTests.java | 2 +- .../client/WebClientVersionTests.java | 2 +- ...ebClientProxyRegistryIntegrationTests.java | 2 +- .../RouterFunctionMappingVersionTests.java | 2 +- .../CachingResourceResolverTests.java | 2 +- .../EncodedResourceResolverTests.java | 2 +- .../VersionRequestConditionTests.java | 2 +- .../annotation/ControllerAdviceTests.java | 2 +- ...RequestMappingVersionIntegrationTests.java | 2 +- ...ebExchangeMethodArgumentResolverTests.java | 2 +- .../reactive/result/view/FragmentTests.java | 2 +- ...gmentViewResolutionResultHandlerTests.java | 2 +- .../view/script/ScriptTemplateViewTests.java | 4 +- .../web/servlet/config/MvcNamespaceTests.java | 2 +- .../DelegatingWebMvcConfigurationTests.java | 2 +- .../annotation/InterceptorRegistryTests.java | 2 +- .../support/HandlerFunctionAdapterTests.java | 2 +- .../RouterFunctionMappingVersionTests.java | 2 +- .../handler/HandlerMethodMappingTests.java | 2 +- .../VersionRequestConditionTests.java | 2 +- .../FragmentRenderingStreamTests.java | 2 +- .../HttpEntityMethodProcessorTests.java | 2 +- .../MvcUriComponentsBuilderTests.java | 2 +- ...questMappingVersionHandlerMethodTests.java | 2 +- .../annotation/ResponseBodyEmitterTests.java | 2 +- .../CachingResourceResolverTests.java | 2 +- .../EncodedResourceResolverTests.java | 2 +- .../ResourceUrlProviderJavaConfigTests.java | 2 +- .../form/AbstractHtmlElementTagTests.java | 2 +- .../servlet/tags/form/CheckboxesTagTests.java | 2 +- .../web/servlet/tags/form/ErrorsTagTests.java | 2 +- .../tags/form/RadioButtonsTagTests.java | 2 +- .../web/servlet/tags/form/SelectTagTests.java | 2 +- .../view/DefaultFragmentsRenderingTests.java | 2 +- .../view/freemarker/FreeMarkerMacroTests.java | 2 +- .../view/script/ScriptTemplateViewTests.java | 4 +- .../SubProtocolWebSocketHandlerTests.java | 2 +- .../standard/SpringConfiguratorTests.java | 2 +- src/checkstyle/checkstyle-suppressions.xml | 7 ++-- 249 files changed, 424 insertions(+), 361 deletions(-) create mode 100644 integration-tests/src/test/java/org/springframework/core/env/Constants.java create mode 100644 spring-context/src/test/java/org/springframework/context/annotation/ImportedConfig.java create mode 100644 spring-context/src/test/java/org/springframework/context/annotation/configuration/Bar.java create mode 100644 spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/MarkerAnnotation.java diff --git a/integration-tests/src/test/java/org/springframework/core/env/Constants.java b/integration-tests/src/test/java/org/springframework/core/env/Constants.java new file mode 100644 index 00000000000..3e01775038c --- /dev/null +++ b/integration-tests/src/test/java/org/springframework/core/env/Constants.java @@ -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"; +} diff --git a/integration-tests/src/test/java/org/springframework/core/env/EnvironmentSystemIntegrationTests.java b/integration-tests/src/test/java/org/springframework/core/env/EnvironmentSystemIntegrationTests.java index 1bf95a7bd55..05da3efd058 100644 --- a/integration-tests/src/test/java/org/springframework/core/env/EnvironmentSystemIntegrationTests.java +++ b/integration-tests/src/test/java/org/springframework/core/env/EnvironmentSystemIntegrationTests.java @@ -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 * @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 { } } - @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 { } } - - /** - * 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"; - } - } diff --git a/integration-tests/src/test/java/org/springframework/core/env/scan1/DevConfig.java b/integration-tests/src/test/java/org/springframework/core/env/scan1/DevConfig.java index c6ed5827551..5347936c812 100644 --- a/integration-tests/src/test/java/org/springframework/core/env/scan1/DevConfig.java +++ b/integration-tests/src/test/java/org/springframework/core/env/scan1/DevConfig.java @@ -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 { diff --git a/integration-tests/src/test/java/org/springframework/core/env/scan1/ProdConfig.java b/integration-tests/src/test/java/org/springframework/core/env/scan1/ProdConfig.java index 18e932f859a..eed6d482a35 100644 --- a/integration-tests/src/test/java/org/springframework/core/env/scan1/ProdConfig.java +++ b/integration-tests/src/test/java/org/springframework/core/env/scan1/ProdConfig.java @@ -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 { diff --git a/integration-tests/src/test/java/org/springframework/core/env/scan2/DevBean.java b/integration-tests/src/test/java/org/springframework/core/env/scan2/DevBean.java index c3b760e4456..e9051f4723d 100644 --- a/integration-tests/src/test/java/org/springframework/core/env/scan2/DevBean.java +++ b/integration-tests/src/test/java/org/springframework/core/env/scan2/DevBean.java @@ -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 { } diff --git a/integration-tests/src/test/java/org/springframework/core/env/scan2/ProdBean.java b/integration-tests/src/test/java/org/springframework/core/env/scan2/ProdBean.java index 002a9aecd3b..c5d5fb191db 100644 --- a/integration-tests/src/test/java/org/springframework/core/env/scan2/ProdBean.java +++ b/integration-tests/src/test/java/org/springframework/core/env/scan2/ProdBean.java @@ -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 { } diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java index 37158f7c02c..b4c9de08649 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPointTests.java @@ -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); } diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJNamespaceHandlerTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJNamespaceHandlerTests.java index 500e0ba0d86..7c273906f4d 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJNamespaceHandlerTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJNamespaceHandlerTests.java @@ -47,7 +47,7 @@ class AspectJNamespaceHandlerTests { @BeforeEach - public void setUp() { + void setUp() { SourceExtractor sourceExtractor = new PassThroughSourceExtractor(); XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.registry); XmlReaderContext readerContext = diff --git a/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java b/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java index 28d04fd12fc..8cc022645f7 100644 --- a/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparatorTests.java @@ -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 { 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 { return advisor; } + static class MessageService { + + public String getMessage() { + return "test"; + } + } + } diff --git a/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java b/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java index 7c14e33d043..bd716b355b8 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java @@ -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 { * We must simulate container shutdown, which should clear threads. */ @AfterEach - public void close() { + void close() { // Will call pool.close() this.beanFactory.destroySingletons(); } diff --git a/spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java b/spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java index 71009789431..e66858adf9a 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java @@ -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")); diff --git a/spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java b/spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java index feb8c761864..2d93cfaf0a7 100644 --- a/spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java +++ b/spring-aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java @@ -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")); diff --git a/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java b/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java index 09138da72bb..615ad1144a2 100644 --- a/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java +++ b/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java @@ -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 { @BeforeEach - public void setUp() { + void setUp() { executor = new CountingExecutor(); AnnotationAsyncExecutionAspect.aspectOf().setExecutor(executor); } diff --git a/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationDrivenBeanDefinitionParserTests.java b/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationDrivenBeanDefinitionParserTests.java index 8bbf37c45af..11d62beb3ae 100644 --- a/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationDrivenBeanDefinitionParserTests.java +++ b/spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationDrivenBeanDefinitionParserTests.java @@ -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(); } diff --git a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/JtaTransactionAspectsTests.java b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/JtaTransactionAspectsTests.java index 1cd105c0df8..903599fdce7 100644 --- a/spring-aspects/src/test/java/org/springframework/transaction/aspectj/JtaTransactionAspectsTests.java +++ b/spring-aspects/src/test/java/org/springframework/transaction/aspectj/JtaTransactionAspectsTests.java @@ -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(); } diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/CustomObjectProviderTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/CustomObjectProviderTests.java index 0f1748a0947..4b012fd79ec 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/CustomObjectProviderTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/CustomObjectProviderTests.java @@ -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() { diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanRegistryAdapterTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanRegistryAdapterTests.java index 84e985d08f5..ce546811580 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanRegistryAdapterTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/BeanRegistryAdapterTests.java @@ -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(); diff --git a/spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java b/spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java index 10fbc44b013..144a3a24f21 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java @@ -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() { diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAndImportAnnotationInteractionTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAndImportAnnotationInteractionTests.java index b16600715f5..b735f5e536f 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAndImportAnnotationInteractionTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAndImportAnnotationInteractionTests.java @@ -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 { static final class Config3 { } - - @ComponentScan("org.springframework.context.annotation.componentscan.simple") - @ComponentScan("org.springframework.context.annotation.componentscan.importing") - public static final class ImportedConfig { - } - } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorAotContributionTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorAotContributionTests.java index 44abc698b9e..656e6143f4a 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorAotContributionTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorAotContributionTests.java @@ -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 { } @Nested - public class BeanRegistrarTests { + class BeanRegistrarTests { @Test void applyToWhenHasDefaultConstructor() throws NoSuchMethodException { diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassWithConditionTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassWithConditionTests.java index 25279f6873c..fdf0e8be2ce 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassWithConditionTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassWithConditionTests.java @@ -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() { diff --git a/spring-context/src/test/java/org/springframework/context/annotation/Gh23206Tests.java b/spring-context/src/test/java/org/springframework/context/annotation/Gh23206Tests.java index 3055a556ffd..9913bb0c9ec 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/Gh23206Tests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/Gh23206Tests.java @@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; * * @author Stephane Nicoll */ -public class Gh23206Tests { +class Gh23206Tests { @Test void componentScanShouldFailWithRegisterBeanCondition() { diff --git a/spring-context/src/test/java/org/springframework/context/annotation/Gh32489Tests.java b/spring-context/src/test/java/org/springframework/context/annotation/Gh32489Tests.java index 97e23cf0ae2..4da34eb07ae 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/Gh32489Tests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/Gh32489Tests.java @@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Stephane Nicoll */ -public class Gh32489Tests { +class Gh32489Tests { @Test void resolveFactoryBeansWithWildcard() { diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java index 3eba082c4c0..619642c951f 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ImportSelectorTests.java @@ -64,7 +64,7 @@ import static org.mockito.Mockito.spy; * @author Stephane Nicoll */ @SuppressWarnings("resource") -public class ImportSelectorTests { +class ImportSelectorTests { static Map, String> importFrom = new HashMap<>(); diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ImportedConfig.java b/spring-context/src/test/java/org/springframework/context/annotation/ImportedConfig.java new file mode 100644 index 00000000000..15fd4a6a8d9 --- /dev/null +++ b/spring-context/src/test/java/org/springframework/context/annotation/ImportedConfig.java @@ -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 { +} diff --git a/spring-context/src/test/java/org/springframework/context/annotation/Spr8954Tests.java b/spring-context/src/test/java/org/springframework/context/annotation/Spr8954Tests.java index 896c899c279..8716277cfb6 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/Spr8954Tests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/Spr8954Tests.java @@ -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() { diff --git a/spring-context/src/test/java/org/springframework/context/annotation/beanregistrar/BeanRegistrarConfigurationTests.java b/spring-context/src/test/java/org/springframework/context/annotation/beanregistrar/BeanRegistrarConfigurationTests.java index 58e00f7c858..04f40c8c002 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/beanregistrar/BeanRegistrarConfigurationTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/beanregistrar/BeanRegistrarConfigurationTests.java @@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; * * @author Sebastien Deleuze */ -public class BeanRegistrarConfigurationTests { +class BeanRegistrarConfigurationTests { @Test void beanRegistrar() { diff --git a/spring-context/src/test/java/org/springframework/context/annotation/componentscan/importing/ImportingConfig.java b/spring-context/src/test/java/org/springframework/context/annotation/componentscan/importing/ImportingConfig.java index 6d5c5134499..22980ed8522 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/componentscan/importing/ImportingConfig.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/componentscan/importing/ImportingConfig.java @@ -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 { } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/Bar.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/Bar.java new file mode 100644 index 00000000000..bce5f84402e --- /dev/null +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/Bar.java @@ -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 { +} diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java index 8494f039f2e..6c54efb1245 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/ImportAnnotationDetectionTests.java @@ -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() { diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/PackagePrivateBeanMethodInheritanceTests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/PackagePrivateBeanMethodInheritanceTests.java index 27bafd60a57..fb99345444e 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/PackagePrivateBeanMethodInheritanceTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/PackagePrivateBeanMethodInheritanceTests.java @@ -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 { } } - public static class Bar { - } - @Configuration public static class ReproConfig extends org.springframework.context.annotation.configuration.a.BaseConfig { @Bean diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/a/BaseConfig.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/a/BaseConfig.java index 40da71e7a24..07e5b25e7b6 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/a/BaseConfig.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/a/BaseConfig.java @@ -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 { diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/MarkerAnnotation.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/MarkerAnnotation.java new file mode 100644 index 00000000000..3ae0ff4a1be --- /dev/null +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/MarkerAnnotation.java @@ -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 { + +} diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/Spr9031Tests.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/Spr9031Tests.java index ef941bbf4c9..fcab3eee952 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/Spr9031Tests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/Spr9031Tests.java @@ -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; * @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 { @Autowired Spr9031Component scanned; } - @Retention(RetentionPolicy.RUNTIME) - public @interface MarkerAnnotation {} - } diff --git a/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/scanpackage/Spr9031Component.java b/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/scanpackage/Spr9031Component.java index 5fa6fa2a454..65efa26de4d 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/scanpackage/Spr9031Component.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/configuration/spr9031/scanpackage/Spr9031Component.java @@ -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 { diff --git a/spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java b/spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java index 289728aba6c..b707fc37037 100644 --- a/spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java @@ -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(); diff --git a/spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java b/spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java index d7be6b6980c..522d2c7e6ba 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java @@ -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; diff --git a/spring-context/src/test/java/org/springframework/scripting/config/ScriptingDefaultsTests.java b/spring-context/src/test/java/org/springframework/scripting/config/ScriptingDefaultsTests.java index b617a89d327..378908fcad6 100644 --- a/spring-context/src/test/java/org/springframework/scripting/config/ScriptingDefaultsTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/config/ScriptingDefaultsTests.java @@ -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"; diff --git a/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java b/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java index d897569ec45..f26e656763f 100644 --- a/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java +++ b/spring-context/src/test/java/org/springframework/scripting/groovy/GroovyScriptFactoryTests.java @@ -63,7 +63,7 @@ import static org.mockito.Mockito.mock; * @author Chris Beams */ @SuppressWarnings("resource") -public class GroovyScriptFactoryTests { +class GroovyScriptFactoryTests { @Test void staticScript() { diff --git a/spring-context/src/testFixtures/java/org/springframework/context/testfixture/cache/AbstractCacheAnnotationTests.java b/spring-context/src/testFixtures/java/org/springframework/context/testfixture/cache/AbstractCacheAnnotationTests.java index 6ff4b495e01..9640dd26564 100644 --- a/spring-context/src/testFixtures/java/org/springframework/context/testfixture/cache/AbstractCacheAnnotationTests.java +++ b/spring-context/src/testFixtures/java/org/springframework/context/testfixture/cache/AbstractCacheAnnotationTests.java @@ -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; */ public abstract class AbstractCacheAnnotationTests { + @AutoClose protected ConfigurableApplicationContext ctx; protected CacheableService cs; @@ -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 { 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(); diff --git a/spring-core-test/src/test/java/org/springframework/aot/agent/InstrumentedMethodTests.java b/spring-core-test/src/test/java/org/springframework/aot/agent/InstrumentedMethodTests.java index 1cace406a49..ecd6b6eab57 100644 --- a/spring-core-test/src/test/java/org/springframework/aot/agent/InstrumentedMethodTests.java +++ b/spring-core-test/src/test/java/org/springframework/aot/agent/InstrumentedMethodTests.java @@ -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) diff --git a/spring-core/src/test/java/org/springframework/core/NullnessTests.java b/spring-core/src/test/java/org/springframework/core/NullnessTests.java index 1cd68ae9093..673251465eb 100644 --- a/spring-core/src/test/java/org/springframework/core/NullnessTests.java +++ b/spring-core/src/test/java/org/springframework/core/NullnessTests.java @@ -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 diff --git a/spring-core/src/test/java/org/springframework/core/io/buffer/JettyDataBufferTests.java b/spring-core/src/test/java/org/springframework/core/io/buffer/JettyDataBufferTests.java index 5e1052f14cc..7d8b7f6bb92 100644 --- a/spring-core/src/test/java/org/springframework/core/io/buffer/JettyDataBufferTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/buffer/JettyDataBufferTests.java @@ -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(); diff --git a/spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java b/spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java index 20ea07a57a1..88c288898ca 100644 --- a/spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java @@ -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 { assertNotPubliclyAccessible(publiclyAccessibleMethod); } + public void publicMethod() { + } + @Test void publicMethodInNonPublicInterface() throws Exception { Class originalType = PrivateInterface.class; diff --git a/spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java b/spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java index 1462baae0d7..b82df944da0 100644 --- a/spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java +++ b/spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java @@ -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); diff --git a/spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationPerformanceTests.java b/spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationPerformanceTests.java index d9d3dc0dd1b..f6ea4b9d689 100644 --- a/spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationPerformanceTests.java +++ b/spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationPerformanceTests.java @@ -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 diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java index 06506a18dd3..fcf85f6a8d4 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/JdbcTemplateTests.java @@ -829,7 +829,7 @@ class JdbcTemplateTests { })); } - void test3BatchesOf2ItemsFailing(Consumer exception) throws Exception { + private void test3BatchesOf2ItemsFailing(Consumer exception) throws Exception { String sql = "INSERT INTO NOSUCHTABLE values (?)"; List ids = Arrays.asList(1, 2, 3, 2, 4, 5); int[] rowsAffected = new int[] {1, 1}; diff --git a/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/HeaderMethodArgumentResolverTests.java b/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/HeaderMethodArgumentResolverTests.java index c029cb05a5f..ba88a1ce063 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/HeaderMethodArgumentResolverTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/HeaderMethodArgumentResolverTests.java @@ -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()); diff --git a/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/MessageMappingMessageHandlerTests.java b/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/MessageMappingMessageHandlerTests.java index cbdcedd3658..373fb505a00 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/reactive/MessageMappingMessageHandlerTests.java +++ b/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; * @author Rossen Stoyanchev */ @SuppressWarnings("ALL") -public class MessageMappingMessageHandlerTests { +class MessageMappingMessageHandlerTests { private TestEncoderMethodReturnValueHandler returnValueHandler; diff --git a/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolverTests.java b/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolverTests.java index 85011c76797..6fae0b12e8d 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolverTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/handler/annotation/support/HeaderMethodArgumentResolverTests.java @@ -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()); diff --git a/spring-messaging/src/test/java/org/springframework/messaging/rsocket/RSocketClientToServerIntegrationTests.java b/spring-messaging/src/test/java/org/springframework/messaging/rsocket/RSocketClientToServerIntegrationTests.java index c4c68689de0..a9a05e629f7 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/rsocket/RSocketClientToServerIntegrationTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/rsocket/RSocketClientToServerIntegrationTests.java @@ -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()); diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandlerTests.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandlerTests.java index 058be016622..b747acee7e5 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandlerTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandlerTests.java @@ -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); diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerTests.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerTests.java index da56d5593cf..c3ed8866e04 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerTests.java @@ -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"; diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/broker/SimpleBrokerMessageHandlerTests.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/broker/SimpleBrokerMessageHandlerTests.java index 28fa521ade3..846bb77c26f 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/broker/SimpleBrokerMessageHandlerTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/broker/SimpleBrokerMessageHandlerTests.java @@ -60,7 +60,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; */ @ExtendWith(MockitoExtension.class) @SuppressWarnings("unchecked") -public class SimpleBrokerMessageHandlerTests { +class SimpleBrokerMessageHandlerTests { private SimpleBrokerMessageHandler messageHandler; diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/DefaultStompSessionTests.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/DefaultStompSessionTests.java index 88b9ce56a6e..e23d558f88a 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/DefaultStompSessionTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/DefaultStompSessionTests.java @@ -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; diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/SplittingStompEncoderTests.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/SplittingStompEncoderTests.java index 45056e2db4a..74d3bd2f2d7 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/SplittingStompEncoderTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/SplittingStompEncoderTests.java @@ -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 diff --git a/spring-messaging/src/test/java/org/springframework/messaging/support/ExecutorSubscribableChannelTests.java b/spring-messaging/src/test/java/org/springframework/messaging/support/ExecutorSubscribableChannelTests.java index 789a7f22d43..ebe7f265522 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/support/ExecutorSubscribableChannelTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/support/ExecutorSubscribableChannelTests.java @@ -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(); diff --git a/spring-oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTests.java index 41dab665531..bbf87165faa 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/AbstractMarshallerTests.java @@ -57,7 +57,7 @@ public abstract class AbstractMarshallerTests { protected Object flights; @BeforeEach - public final void setUp() throws Exception { + final void setUp() throws Exception { marshaller = createMarshaller(); flights = createFlights(); } diff --git a/spring-oxm/src/test/java/org/springframework/oxm/AbstractUnmarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/AbstractUnmarshallerTests.java index 6d78c05f5e1..fa7b7ed1b3d 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/AbstractUnmarshallerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/AbstractUnmarshallerTests.java @@ -59,7 +59,7 @@ public abstract class AbstractUnmarshallerTests { "42"; @BeforeEach - public final void setUp() throws Exception { + final void setUp() throws Exception { unmarshaller = createUnmarshaller(); } diff --git a/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/init/ScriptUtilsTests.java b/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/init/ScriptUtilsTests.java index b757a6bbc0b..774341099b8 100644 --- a/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/init/ScriptUtilsTests.java +++ b/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/init/ScriptUtilsTests.java @@ -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); diff --git a/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/lookup/BeanFactoryConnectionFactoryLookupTests.java b/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/lookup/BeanFactoryConnectionFactoryLookupTests.java index 23923f41452..429ad3a5727 100644 --- a/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/lookup/BeanFactoryConnectionFactoryLookupTests.java +++ b/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/lookup/BeanFactoryConnectionFactoryLookupTests.java @@ -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"; diff --git a/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractDatabaseClientIntegrationTests.java b/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractDatabaseClientIntegrationTests.java index 6508828c33c..1fbf3760a9e 100644 --- a/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractDatabaseClientIntegrationTests.java +++ b/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractDatabaseClientIntegrationTests.java @@ -47,7 +47,7 @@ abstract class AbstractDatabaseClientIntegrationTests { @BeforeEach - public void before() { + protected void before() { connectionFactory = createConnectionFactory(); Mono.from(connectionFactory.create()) diff --git a/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractTransactionalDatabaseClientIntegrationTests.java b/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractTransactionalDatabaseClientIntegrationTests.java index 724f23b5197..40d3ec2e482 100644 --- a/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractTransactionalDatabaseClientIntegrationTests.java +++ b/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/AbstractTransactionalDatabaseClientIntegrationTests.java @@ -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 { private ConnectionFactory connectionFactory; + @AutoClose AnnotationConfigApplicationContext context; DatabaseClient databaseClient; @@ -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 { rxtx = TransactionalOperator.create(transactionManager); } - @AfterEach - public void tearDown() { - context.close(); - } - /** * Create a {@link ConnectionFactory} to be used in this test. diff --git a/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/H2DatabaseClientContextIntegrationTests.java b/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/H2DatabaseClientContextIntegrationTests.java index 6836669c59a..1c75f4b5a6b 100644 --- a/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/H2DatabaseClientContextIntegrationTests.java +++ b/spring-r2dbc/src/test/java/org/springframework/r2dbc/core/H2DatabaseClientContextIntegrationTests.java @@ -45,7 +45,7 @@ class H2DatabaseClientContextIntegrationTests extends H2DatabaseClientIntegratio } @AfterEach - public void tearDown() { + void tearDown() { context.close(); assertThatExceptionOfType(R2dbcNonTransientResourceException.class).isThrownBy( () -> connectionFactory.create().block()); diff --git a/spring-test/src/test/java/org/springframework/test/context/cache/ContextCacheTestSuite.java b/spring-test/src/test/java/org/springframework/test/context/cache/ContextCacheTestSuite.java index 8e4d3df73f1..f98593ab27f 100644 --- a/spring-test/src/test/java/org/springframework/test/context/cache/ContextCacheTestSuite.java +++ b/spring-test/src/test/java/org/springframework/test/context/cache/ContextCacheTestSuite.java @@ -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 { } diff --git a/spring-test/src/test/java/org/springframework/test/context/config/ContextConfigTestSuite.java b/spring-test/src/test/java/org/springframework/test/context/config/ContextConfigTestSuite.java index 7461f2af9fa..9092d77dc2e 100644 --- a/spring-test/src/test/java/org/springframework/test/context/config/ContextConfigTestSuite.java +++ b/spring-test/src/test/java/org/springframework/test/context/config/ContextConfigTestSuite.java @@ -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 { } diff --git a/spring-test/src/test/java/org/springframework/test/context/event/CustomTestEventTests.java b/spring-test/src/test/java/org/springframework/test/context/event/CustomTestEventTests.java index 832cd78e26d..12ad819f930 100644 --- a/spring-test/src/test/java/org/springframework/test/context/event/CustomTestEventTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/event/CustomTestEventTests.java @@ -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 events = new ArrayList<>(); @BeforeEach - public void clearEvents() { + void clearEvents() { events.clear(); } diff --git a/spring-test/src/test/java/org/springframework/test/context/event/EventPublishingTestExecutionListenerIntegrationTests.java b/spring-test/src/test/java/org/springframework/test/context/event/EventPublishingTestExecutionListenerIntegrationTests.java index d6e9983df13..262bcc1885f 100644 --- a/spring-test/src/test/java/org/springframework/test/context/event/EventPublishingTestExecutionListenerIntegrationTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/event/EventPublishingTestExecutionListenerIntegrationTests.java @@ -66,7 +66,7 @@ import static org.mockito.Mockito.verify; * @author Sam Brannen * @since 5.2 */ -public class EventPublishingTestExecutionListenerIntegrationTests { +class EventPublishingTestExecutionListenerIntegrationTests { private static final String THREAD_NAME_PREFIX = "Test-"; @@ -88,7 +88,7 @@ public class EventPublishingTestExecutionListenerIntegrationTests { @AfterEach - public void closeApplicationContext() { + void closeApplicationContext() { this.testContext.markApplicationContextDirty(null); } diff --git a/spring-test/src/test/java/org/springframework/test/context/hierarchies/web/DispatcherWacRootWacEarTests.java b/spring-test/src/test/java/org/springframework/test/context/hierarchies/web/DispatcherWacRootWacEarTests.java index ca9585be7ad..e6f78e2f1f9 100644 --- a/spring-test/src/test/java/org/springframework/test/context/hierarchies/web/DispatcherWacRootWacEarTests.java +++ b/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; */ @ContextHierarchy(@ContextConfiguration) @DisabledInAotMode("@ContextHierarchy is not supported in AOT") -public class DispatcherWacRootWacEarTests extends RootWacEarTests { +class DispatcherWacRootWacEarTests extends RootWacEarTests { @Autowired private WebApplicationContext wac; diff --git a/spring-test/src/test/java/org/springframework/test/context/initializers/AciTestSuite.java b/spring-test/src/test/java/org/springframework/test/context/initializers/AciTestSuite.java index 1e7f02b5828..b9134284a49 100644 --- a/spring-test/src/test/java/org/springframework/test/context/initializers/AciTestSuite.java +++ b/spring-test/src/test/java/org/springframework/test/context/initializers/AciTestSuite.java @@ -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 { } diff --git a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/InitializerConfiguredViaMetaAnnotationTests.java b/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/InitializerConfiguredViaMetaAnnotationTests.java index afa1f583b99..e9b0fde30ac 100644 --- a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/InitializerConfiguredViaMetaAnnotationTests.java +++ b/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; */ @ExtendWith(SpringExtension.class) @ComposedContextConfiguration(BarConfig.class) -public class InitializerConfiguredViaMetaAnnotationTests { +class InitializerConfiguredViaMetaAnnotationTests { @Autowired String foo; diff --git a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/InitializerWithoutConfigFilesOrClassesTests.java b/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/InitializerWithoutConfigFilesOrClassesTests.java index 0ecd4953ff7..4a072dcb7e9 100644 --- a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/InitializerWithoutConfigFilesOrClassesTests.java +++ b/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; * @since 3.2 */ @SpringJUnitConfig(initializers = EntireAppInitializer.class) -public class InitializerWithoutConfigFilesOrClassesTests { +class InitializerWithoutConfigFilesOrClassesTests { @Autowired private String foo; diff --git a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/MergedInitializersAnnotationConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/MergedInitializersAnnotationConfigTests.java index e7b5e75970a..390d658192e 100644 --- a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/MergedInitializersAnnotationConfigTests.java +++ b/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; * @since 3.2 */ @SpringJUnitConfig(initializers = DevProfileInitializer.class) -public class MergedInitializersAnnotationConfigTests extends SingleInitializerAnnotationConfigTests { +class MergedInitializersAnnotationConfigTests extends SingleInitializerAnnotationConfigTests { @Override @Test diff --git a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/MultipleInitializersAnnotationConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/MultipleInitializersAnnotationConfigTests.java index ecc3c080cc2..185ec611306 100644 --- a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/MultipleInitializersAnnotationConfigTests.java +++ b/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; */ @SpringJUnitConfig(classes = { GlobalConfig.class, DevProfileConfig.class }, initializers = { FooBarAliasInitializer.class, DevProfileInitializer.class }) -public class MultipleInitializersAnnotationConfigTests { +class MultipleInitializersAnnotationConfigTests { @Autowired private String foo, bar, baz; diff --git a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/OrderedInitializersAnnotationConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/OrderedInitializersAnnotationConfigTests.java index 50c5171c900..da5a5b49268 100644 --- a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/OrderedInitializersAnnotationConfigTests.java +++ b/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; // 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"; diff --git a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/OverriddenInitializersAnnotationConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/OverriddenInitializersAnnotationConfigTests.java index 7fdcada6f81..b6bb0506680 100644 --- a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/OverriddenInitializersAnnotationConfigTests.java +++ b/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; * @since 3.2 */ @SpringJUnitConfig(initializers = DevProfileInitializer.class, inheritInitializers = false) -public class OverriddenInitializersAnnotationConfigTests extends SingleInitializerAnnotationConfigTests { +class OverriddenInitializersAnnotationConfigTests extends SingleInitializerAnnotationConfigTests { @Test @Override diff --git a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/PropertySourcesInitializerTests.java b/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/PropertySourcesInitializerTests.java index 59e4ccec956..963efb22616 100644 --- a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/PropertySourcesInitializerTests.java +++ b/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; * @since 4.1 */ @SpringJUnitConfig(initializers = PropertySourcesInitializerTests.PropertySourceInitializer.class) -public class PropertySourcesInitializerTests { +class PropertySourcesInitializerTests { @Configuration static class Config { diff --git a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/SingleInitializerAnnotationConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/SingleInitializerAnnotationConfigTests.java index 6834676a412..2c0a532c7d7 100644 --- a/spring-test/src/test/java/org/springframework/test/context/initializers/annotation/SingleInitializerAnnotationConfigTests.java +++ b/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; * @since 3.2 */ @SpringJUnitConfig(classes = { GlobalConfig.class, DevProfileConfig.class }, initializers = FooBarAliasInitializer.class) -public class SingleInitializerAnnotationConfigTests { +class SingleInitializerAnnotationConfigTests { @Autowired protected String foo; diff --git a/spring-test/src/test/java/org/springframework/test/context/initializers/xml/MultipleInitializersXmlConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/initializers/xml/MultipleInitializersXmlConfigTests.java index f7015190c76..6174a4a11bd 100644 --- a/spring-test/src/test/java/org/springframework/test/context/initializers/xml/MultipleInitializersXmlConfigTests.java +++ b/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; * @since 3.2 */ @SpringJUnitConfig(initializers = { FooBarAliasInitializer.class, DevProfileInitializer.class }) -public class MultipleInitializersXmlConfigTests { +class MultipleInitializersXmlConfigTests { @Autowired private String foo, bar, baz; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/SpringJUnitJupiterTestSuite.java b/spring-test/src/test/java/org/springframework/test/context/junit/SpringJUnitJupiterTestSuite.java index f51ad4ab2dd..61d243fa37b 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/SpringJUnitJupiterTestSuite.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/SpringJUnitJupiterTestSuite.java @@ -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 { } diff --git a/spring-test/src/test/java/org/springframework/test/context/profile/importresource/DevProfileResolverAnnotationConfigTests.java b/spring-test/src/test/java/org/springframework/test/context/profile/importresource/DevProfileResolverAnnotationConfigTests.java index d192a08a0cb..2e3b1fd61c8 100644 --- a/spring-test/src/test/java/org/springframework/test/context/profile/importresource/DevProfileResolverAnnotationConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/profile/importresource/DevProfileResolverAnnotationConfigTests.java @@ -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" }; } + } diff --git a/spring-test/src/test/java/org/springframework/test/util/ExceptionCollectorTests.java b/spring-test/src/test/java/org/springframework/test/util/ExceptionCollectorTests.java index 76b70c930c0..235e200a33d 100644 --- a/spring-test/src/test/java/org/springframework/test/util/ExceptionCollectorTests.java +++ b/spring-test/src/test/java/org/springframework/test/util/ExceptionCollectorTests.java @@ -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'; diff --git a/spring-test/src/test/java/org/springframework/test/web/client/match/ContentRequestMatchersTests.java b/spring-test/src/test/java/org/springframework/test/web/client/match/ContentRequestMatchersTests.java index 990cdd9d396..708a594f824 100644 --- a/spring-test/src/test/java/org/springframework/test/web/client/match/ContentRequestMatchersTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/client/match/ContentRequestMatchersTests.java @@ -37,7 +37,7 @@ import static org.hamcrest.Matchers.hasXPath; * * @author Rossen Stoyanchev */ -public class ContentRequestMatchersTests { +class ContentRequestMatchersTests { private final MockClientHttpRequest request = new MockClientHttpRequest(); diff --git a/spring-test/src/test/java/org/springframework/test/web/client/match/JsonPathRequestMatchersTests.java b/spring-test/src/test/java/org/springframework/test/web/client/match/JsonPathRequestMatchersTests.java index 8b6e61cdb43..386f9cfb743 100644 --- a/spring-test/src/test/java/org/springframework/test/web/client/match/JsonPathRequestMatchersTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/client/match/JsonPathRequestMatchersTests.java @@ -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', " + // diff --git a/spring-test/src/test/java/org/springframework/test/web/client/match/MultipartRequestMatchersTests.java b/spring-test/src/test/java/org/springframework/test/web/client/match/MultipartRequestMatchersTests.java index 42accf01606..c6bc3863728 100644 --- a/spring-test/src/test/java/org/springframework/test/web/client/match/MultipartRequestMatchersTests.java +++ b/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; * @author Valentin Spac * @author Rossen Stoyanchev */ -public class MultipartRequestMatchersTests { +class MultipartRequestMatchersTests { private final MockClientHttpRequest request = new MockClientHttpRequest(); @@ -54,7 +54,7 @@ public class MultipartRequestMatchersTests { @BeforeEach - public void setup() { + void setup() { this.request.getHeaders().setContentType(MediaType.MULTIPART_FORM_DATA); } diff --git a/spring-test/src/test/java/org/springframework/test/web/client/match/XpathRequestMatchersTests.java b/spring-test/src/test/java/org/springframework/test/web/client/match/XpathRequestMatchersTests.java index ac30ed597e8..d621e5d95ba 100644 --- a/spring-test/src/test/java/org/springframework/test/web/client/match/XpathRequestMatchersTests.java +++ b/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; * * @author Rossen Stoyanchev */ -public class XpathRequestMatchersTests { +class XpathRequestMatchersTests { private static final String RESPONSE_CONTENT = "111true"; @@ -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()); } diff --git a/spring-test/src/test/java/org/springframework/test/web/client/samples/matchers/XpathRequestMatchersIntegrationTests.java b/spring-test/src/test/java/org/springframework/test/web/client/samples/matchers/XpathRequestMatchersIntegrationTests.java index d142a1f676b..83560ae174f 100644 --- a/spring-test/src/test/java/org/springframework/test/web/client/samples/matchers/XpathRequestMatchersIntegrationTests.java +++ b/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 * @see ContentRequestMatchersIntegrationTests * @see XmlContentRequestMatchersIntegrationTests */ -public class XpathRequestMatchersIntegrationTests { +class XpathRequestMatchersIntegrationTests { private static final Map NS = Collections.singletonMap("ns", "https://example.org/music/people"); @@ -67,7 +67,7 @@ public class XpathRequestMatchersIntegrationTests { @BeforeEach - public void setup() { + void setup() { List composers = Arrays.asList( new Person("Johann Sebastian Bach").setSomeDouble(21), new Person("Johannes Brahms").setSomeDouble(.0025), diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/ApplicationContextSpecTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/ApplicationContextSpecTests.java index 9f35e704dd5..7d8a4577f41 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/ApplicationContextSpecTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/reactive/server/ApplicationContextSpecTests.java @@ -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() { diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java index 29c0e6476cb..7f3f97c9e0e 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java +++ b/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; * * @author Rossen Stoyanchev */ -public class DefaultControllerSpecTests { +class DefaultControllerSpecTests { @Test void controller() { diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultRouterFunctionSpecTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultRouterFunctionSpecTests.java index ef289507b24..28a169d0be2 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultRouterFunctionSpecTests.java +++ b/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; * * @author Rossen Stoyanchev */ -public class DefaultRouterFunctionSpecTests { +class DefaultRouterFunctionSpecTests { @Test void webFilter() { diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/HttpHandlerConnectorTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/HttpHandlerConnectorTests.java index adf1c84ae17..55380b9a548 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/HttpHandlerConnectorTests.java +++ b/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; * * @author Rossen Stoyanchev */ -public class HttpHandlerConnectorTests { +class HttpHandlerConnectorTests { @Test void adaptRequest() { diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/MockServerSpecTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/MockServerSpecTests.java index 474b3cc4957..85982f59165 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/MockServerSpecTests.java +++ b/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; * Tests for {@link AbstractMockServerSpec}. * @author Rossen Stoyanchev */ -public class MockServerSpecTests { +class MockServerSpecTests { private final TestMockServerSpec serverSpec = new TestMockServerSpec(); diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/MockServerTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/MockServerTests.java index 4503ec45460..aecb1b61bb9 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/MockServerTests.java +++ b/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; * Test scenarios involving a mock server. * @author Rossen Stoyanchev */ -public class MockServerTests { - +class MockServerTests { @Test // SPR-15674 (in comments) void mutateDoesNotCreateNewSession() { diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/WiretapConnectorTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/WiretapConnectorTests.java index 5a12d5f3e5d..2226547f2f3 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/WiretapConnectorTests.java +++ b/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; * @author Rossen Stoyanchev * @since 5.0 */ -public class WiretapConnectorTests { +class WiretapConnectorTests { private final LeakAwareDataBufferFactory bufferFactory = new LeakAwareDataBufferFactory(new NettyDataBufferFactory(PooledByteBufAllocator.DEFAULT)); diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/assertj/WebTestClientResponseTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/assertj/WebTestClientResponseTests.java index 8d9792cb863..9b20852a6e8 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/assertj/WebTestClientResponseTests.java +++ b/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; * * @author Rossen Stoyanchev */ -public class WebTestClientResponseTests { +class WebTestClientResponseTests { private final WebTestClient client = WebTestClient.bindToController(HelloController.class).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/ApiVersionTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/ApiVersionTests.java index 457db241c65..cc09a2b1782 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/ApiVersionTests.java +++ b/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; * * @author Rossen Stoyanchev */ -public class ApiVersionTests { +class ApiVersionTests { @Test void header() { diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/GlobalEntityResultConsumerTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/GlobalEntityResultConsumerTests.java index 71879ecdae5..eb0d9c4b065 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/GlobalEntityResultConsumerTests.java +++ b/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; * * @author Rossen Stoyanchev */ -public class GlobalEntityResultConsumerTests { +class GlobalEntityResultConsumerTests { private final StringBuilder output = new StringBuilder(); diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/ControllerTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/ControllerTests.java index a0929197740..fa058cc7301 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/ControllerTests.java +++ b/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; * * @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(); } diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/HttpServerTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/HttpServerTests.java index 42798bd12d8..8010b487d6b 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/HttpServerTests.java +++ b/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 * @author Rossen Stoyanchev * @since 5.0 */ -public class HttpServerTests { +class HttpServerTests { private ReactorHttpServer server; @@ -43,7 +43,7 @@ public class HttpServerTests { @BeforeEach - public void start() throws Exception { + void start() throws Exception { HttpHandler httpHandler = RouterFunctions.toHttpHandler( route(GET("/test"), request -> ServerResponse.ok().bodyValue("It works!"))); @@ -58,7 +58,7 @@ public class HttpServerTests { } @AfterEach - public void stop() { + void stop() { this.server.stop(); } diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/RouterFunctionTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/RouterFunctionTests.java index 015858273f5..d178bbdd212 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/RouterFunctionTests.java +++ b/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 * @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!")); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java index a59f567ffbc..5fae7806a68 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/DefaultMvcResultTests.java @@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; * * @author Rossen Stoyanchev */ -public class DefaultMvcResultTests { +class DefaultMvcResultTests { private final DefaultMvcResult mvcResult = new DefaultMvcResult(new MockHttpServletRequest(), null); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/AbstractHttpServletRequestAssertTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/AbstractHttpServletRequestAssertTests.java index 1f9280d93ad..d7a2369541a 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/AbstractHttpServletRequestAssertTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/AbstractHttpServletRequestAssertTests.java @@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; * * @author Stephane Nicoll */ -public class AbstractHttpServletRequestAssertTests { +class AbstractHttpServletRequestAssertTests { @Nested class AttributesTests { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/AbstractMockHttpServletResponseAssertTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/AbstractMockHttpServletResponseAssertTests.java index 9ffa1c23d39..b9680b5155c 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/AbstractMockHttpServletResponseAssertTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/AbstractMockHttpServletResponseAssertTests.java @@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; * * @author Stephane Nicoll */ -public class AbstractMockHttpServletResponseAssertTests { +class AbstractMockHttpServletResponseAssertTests { @Test void bodyText() { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/MockMvcTesterIntegrationTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/MockMvcTesterIntegrationTests.java index c164828f5e7..58c56538535 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/MockMvcTesterIntegrationTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/assertj/MockMvcTesterIntegrationTests.java @@ -96,7 +96,7 @@ import static org.mockito.Mockito.verifyNoInteractions; * @author Stephane Nicoll */ @SpringJUnitWebConfig -public class MockMvcTesterIntegrationTests { +class MockMvcTesterIntegrationTests { private static final MockMultipartFile file = new MockMultipartFile("file", "content.txt", null, "value".getBytes(StandardCharsets.UTF_8)); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/client/assertj/RestTestClientResponseTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/client/assertj/RestTestClientResponseTests.java index 1e61eb22109..d7cda42c043 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/client/assertj/RestTestClientResponseTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/client/assertj/RestTestClientResponseTests.java @@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Rossen Stoyanchev */ -public class RestTestClientResponseTests { +class RestTestClientResponseTests { private final RestTestClient client = RestTestClient.bindToController(HelloController.class) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/client/samples/ApiVersionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/client/samples/ApiVersionTests.java index a9b8d0a4ff5..dad8a012a0e 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/client/samples/ApiVersionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/client/samples/ApiVersionTests.java @@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Rossen Stoyanchev */ -public class ApiVersionTests { +class ApiVersionTests { @Test void header() { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcherTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcherTests.java index 103537c2c88..fb0b94d86f6 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcherTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HostRequestMatcherTests.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; * @author Sam Brannen * @since 4.2 */ -public class HostRequestMatcherTests extends AbstractWebRequestMatcherTests { +class HostRequestMatcherTests extends AbstractWebRequestMatcherTests { @Test void localhost() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilderTests.java index 10cd5273182..72052f849b2 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilderTests.java @@ -55,7 +55,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder * @author Sam Brannen * @since 4.2 */ -public class HtmlUnitRequestBuilderTests { +class HtmlUnitRequestBuilderTests { private final WebClient webClient = new WebClient(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcConnectionBuilderSupportTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcConnectionBuilderSupportTests.java index f8d5199782f..d80b9bea467 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcConnectionBuilderSupportTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcConnectionBuilderSupportTests.java @@ -51,7 +51,7 @@ import static org.mockito.Mockito.mock; */ @SpringJUnitWebConfig @SuppressWarnings("rawtypes") -public class MockMvcConnectionBuilderSupportTests { +class MockMvcConnectionBuilderSupportTests { private final WebClient client = mock(); @@ -62,7 +62,7 @@ public class MockMvcConnectionBuilderSupportTests { @BeforeEach - public void setup() { + void setup() { given(this.client.getWebConnection()).willReturn(mock()); this.builder = new MockMvcWebConnectionBuilderSupport(this.wac) {}; } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java index 5b5408945d4..44ed3a8635c 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java @@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; * @author Rob Winch * @since 4.2 */ -public class MockMvcWebConnectionTests { +class MockMvcWebConnectionTests { private final WebClient webClient = new WebClient(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilderTests.java index 3dfcf66cb83..4c215a29ccd 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockWebResponseBuilderTests.java @@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException * @author Rob Winch * @since 4.2 */ -public class MockWebResponseBuilderTests { +class MockWebResponseBuilderTests { private final MockHttpServletResponse response = new MockHttpServletResponse(); @@ -48,7 +48,7 @@ public class MockWebResponseBuilderTests { @BeforeEach - public void setup() throws Exception { + void setup() throws Exception { this.webRequest = new WebRequest(new URL("http://company.example:80/test/this/here")); this.responseBuilder = new MockWebResponseBuilder(System.currentTimeMillis(), this.webRequest, this.response); } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcherTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcherTests.java index e8c544b8ecb..181f6543e42 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcherTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/UrlRegexRequestMatcherTests.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; * @author Sam Brannen * @since 4.2 */ -public class UrlRegexRequestMatcherTests extends AbstractWebRequestMatcherTests { +class UrlRegexRequestMatcherTests extends AbstractWebRequestMatcherTests { @Test void verifyExampleInClassLevelJavadoc() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/request/AbstractMockMultipartHttpServletRequestBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/request/AbstractMockMultipartHttpServletRequestBuilderTests.java index fb50f6a7bff..ded979792e4 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/request/AbstractMockMultipartHttpServletRequestBuilderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/request/AbstractMockMultipartHttpServletRequestBuilderTests.java @@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Stephane Nicoll */ -public class AbstractMockMultipartHttpServletRequestBuilderTests { +class AbstractMockMultipartHttpServletRequestBuilderTests { private final ServletContext servletContext = new MockServletContext(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/request/MockMultipartHttpServletRequestBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/request/MockMultipartHttpServletRequestBuilderTests.java index 3700e5ba0b2..e8eb47bff2d 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/request/MockMultipartHttpServletRequestBuilderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/request/MockMultipartHttpServletRequestBuilderTests.java @@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat; * Tests for {@link MockMultipartHttpServletRequestBuilder}. * @author Rossen Stoyanchev */ -public class MockMultipartHttpServletRequestBuilderTests { +class MockMultipartHttpServletRequestBuilderTests { @Test // gh-26166 void addFileAndParts() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/result/FlashAttributeResultMatchersTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/result/FlashAttributeResultMatchersTests.java index cbc83263eb6..14f6076b099 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/result/FlashAttributeResultMatchersTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/result/FlashAttributeResultMatchersTests.java @@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; /** * @author Craig Walls */ -public class FlashAttributeResultMatchersTests { +class FlashAttributeResultMatchersTests { @Test void attributeExists() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/result/HeaderResultMatchersTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/result/HeaderResultMatchersTests.java index 2c3784f708c..28c66842e44 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/result/HeaderResultMatchersTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/result/HeaderResultMatchersTests.java @@ -32,7 +32,7 @@ import org.springframework.test.web.servlet.StubMvcResult; * * @author Rossen Stoyanchev */ -public class HeaderResultMatchersTests { +class HeaderResultMatchersTests { private final HeaderResultMatchers matchers = new HeaderResultMatchers(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/result/MockMvcResultMatchersTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/result/MockMvcResultMatchersTests.java index 8038c5dfa34..bae29cbf992 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/result/MockMvcResultMatchersTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/result/MockMvcResultMatchersTests.java @@ -36,7 +36,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * @author Brian Clozel * @author Sam Brannen */ -public class MockMvcResultMatchersTests { +class MockMvcResultMatchersTests { @Test void redirect() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/result/StatusResultMatchersTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/result/StatusResultMatchersTests.java index beafff572fc..268e83ae987 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/result/StatusResultMatchersTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/result/StatusResultMatchersTests.java @@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.fail; * * @author Rossen Stoyanchev */ -public class StatusResultMatchersTests { +class StatusResultMatchersTests { private final StatusResultMatchers matchers = new StatusResultMatchers(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/result/XpathResultMatchersTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/result/XpathResultMatchersTests.java index 35e71e0f0b2..fa6d35efd5f 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/result/XpathResultMatchersTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/result/XpathResultMatchersTests.java @@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; * * @author Rossen Stoyanchev */ -public class XpathResultMatchersTests { +class XpathResultMatchersTests { private static final String RESPONSE_CONTENT = "111true"; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/AsyncControllerJavaConfigTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/AsyncControllerJavaConfigTests.java index 05fd0fc1283..f4ea0d1e7aa 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/AsyncControllerJavaConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/AsyncControllerJavaConfigTests.java @@ -57,7 +57,7 @@ import static org.mockito.Mockito.mock; @WebAppConfiguration @ContextHierarchy(@ContextConfiguration(classes = AsyncControllerJavaConfigTests.WebConfig.class)) @DisabledInAotMode("@ContextHierarchy is not supported in AOT") -public class AsyncControllerJavaConfigTests { +class AsyncControllerJavaConfigTests { @Autowired private WebApplicationContext wac; @@ -69,7 +69,7 @@ public class AsyncControllerJavaConfigTests { @BeforeEach - public void setup() { + void setup() { this.testClient = MockMvcWebTestClient.bindToApplicationContext(this.wac).build(); } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/WebAppResourceTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/WebAppResourceTests.java index 1031d674954..9156b5d3141 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/WebAppResourceTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/WebAppResourceTests.java @@ -50,7 +50,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @ContextConfiguration("../../context/servlet-context.xml") }) @DisabledInAotMode("@ContextHierarchy is not supported in AOT") -public class WebAppResourceTests { +class WebAppResourceTests { @Autowired private WebApplicationContext wac; @@ -59,7 +59,7 @@ public class WebAppResourceTests { @BeforeEach - public void setup() { + void setup() { this.testClient = MockMvcWebTestClient.bindToApplicationContext(this.wac).build(); } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/XmlConfigTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/XmlConfigTests.java index 290798f91c4..fb9e670107d 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/XmlConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/context/XmlConfigTests.java @@ -48,7 +48,7 @@ import static org.mockito.BDDMockito.given; @ContextConfiguration("../../context/servlet-context.xml") }) @DisabledInAotMode("@ContextHierarchy is not supported in AOT") -public class XmlConfigTests { +class XmlConfigTests { @Autowired private WebApplicationContext wac; @@ -60,7 +60,7 @@ public class XmlConfigTests { @BeforeEach - public void setup() { + void setup() { this.testClient = MockMvcWebTestClient.bindToApplicationContext(this.wac).build(); given(this.personDao.getPerson(5L)).willReturn(new Person("Joe")); } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/FilterTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/FilterTests.java index 49bc94bdaa4..10dfc093d6b 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/FilterTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/FilterTests.java @@ -58,7 +58,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class FilterTests { +class FilterTests { @Test void whenFiltersCompleteMvcProcessesRequest() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/FrameworkExtensionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/FrameworkExtensionTests.java index 1179a11204c..8d2fcaaf900 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/FrameworkExtensionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/FrameworkExtensionTests.java @@ -47,7 +47,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class FrameworkExtensionTests { +class FrameworkExtensionTests { private final WebTestClient client = MockMvcWebTestClient.bindToController(new SampleController()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/MultipartControllerTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/MultipartControllerTests.java index e810e7bd132..39e23f15494 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/MultipartControllerTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/MultipartControllerTests.java @@ -52,7 +52,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Rossen Stoyanchev */ -public class MultipartControllerTests { +class MultipartControllerTests { private final WebTestClient testClient = MockMvcWebTestClient.bindToController(new MultipartController()).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/ReactiveReturnTypeTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/ReactiveReturnTypeTests.java index 8e48aff6f35..c6deda3e070 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/ReactiveReturnTypeTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/ReactiveReturnTypeTests.java @@ -36,7 +36,7 @@ import static org.springframework.http.MediaType.TEXT_EVENT_STREAM; * * @author Rossen Stoyanchev */ -public class ReactiveReturnTypeTests { +class ReactiveReturnTypeTests { @Test void sseWithFlux() { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/RedirectTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/RedirectTests.java index b7286f74443..41e05580546 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/RedirectTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/RedirectTests.java @@ -43,7 +43,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class RedirectTests { +class RedirectTests { private final WebTestClient testClient = MockMvcWebTestClient.bindToController(new PersonController()).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/RequestParameterTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/RequestParameterTests.java index 7ef78fef82d..2bc3de3c98f 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/RequestParameterTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/RequestParameterTests.java @@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody; * * @author Rossen Stoyanchev */ -public class RequestParameterTests { +class RequestParameterTests { @Test void queryParameter() { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/SseTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/SseTests.java index 53e7038681e..3c1f94ff952 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/SseTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/SseTests.java @@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Rossen Stoyanchev */ -public class SseTests { +class SseTests { private final WebTestClient testClient = MockMvcWebTestClient.bindToController(new SseController()).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resulthandlers/PrintingResultHandlerSmokeTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resulthandlers/PrintingResultHandlerSmokeTests.java index 2f40ca93516..c88d8d4130a 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resulthandlers/PrintingResultHandlerSmokeTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resulthandlers/PrintingResultHandlerSmokeTests.java @@ -37,7 +37,7 @@ import org.springframework.web.bind.annotation.RestController; * @author Rossen Stoyanchev */ @Disabled -public class PrintingResultHandlerSmokeTests { +class PrintingResultHandlerSmokeTests { private final WebTestClient testClient = MockMvcWebTestClient.bindToController(new SimpleController()).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/CookieAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/CookieAssertionTests.java index 434c950deaa..8366c6e8ae6 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/CookieAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/CookieAssertionTests.java @@ -39,7 +39,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class CookieAssertionTests { +class CookieAssertionTests { private static final String COOKIE_NAME = CookieLocaleResolver.DEFAULT_COOKIE_NAME; @@ -47,7 +47,7 @@ public class CookieAssertionTests { @BeforeEach - public void setup() { + void setup() { CookieLocaleResolver localeResolver = new CookieLocaleResolver(); localeResolver.setCookieDomain("domain"); localeResolver.setCookieHttpOnly(true); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/FlashAttributeAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/FlashAttributeAssertionTests.java index 13d68ac1178..3b403c31d0c 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/FlashAttributeAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/FlashAttributeAssertionTests.java @@ -42,7 +42,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class FlashAttributeAssertionTests { +class FlashAttributeAssertionTests { private final WebTestClient client = MockMvcWebTestClient.bindToController(new PersonController()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/HandlerAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/HandlerAssertionTests.java index fab507a4c17..583613d0061 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/HandlerAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/HandlerAssertionTests.java @@ -43,7 +43,7 @@ import static org.springframework.web.servlet.mvc.method.annotation.MvcUriCompon * * @author Rossen Stoyanchev */ -public class HandlerAssertionTests { +class HandlerAssertionTests { private final WebTestClient client = MockMvcWebTestClient.bindToController(new SimpleController()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/JsonPathAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/JsonPathAssertionTests.java index 9f767b17ca8..cc5c2d9b562 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/JsonPathAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/JsonPathAssertionTests.java @@ -46,7 +46,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class JsonPathAssertionTests { +class JsonPathAssertionTests { private final WebTestClient client = MockMvcWebTestClient.bindToController(new MusicController()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/ModelAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/ModelAssertionTests.java index 96a6d29b9aa..79e74dba9a1 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/ModelAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/ModelAssertionTests.java @@ -49,7 +49,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class ModelAssertionTests { +class ModelAssertionTests { private final WebTestClient client = MockMvcWebTestClient.bindToController(new SampleController("a string value", 3, new Person("a name"))) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/RequestAttributeAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/RequestAttributeAssertionTests.java index d9bf969bd8c..ba4a095d946 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/RequestAttributeAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/RequestAttributeAssertionTests.java @@ -39,7 +39,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class RequestAttributeAssertionTests { +class RequestAttributeAssertionTests { private final WebTestClient mainServletClient = MockMvcWebTestClient.bindToController(new SimpleController()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/SessionAttributeAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/SessionAttributeAssertionTests.java index d7b54cb16d7..65e70a6d12e 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/SessionAttributeAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/SessionAttributeAssertionTests.java @@ -44,7 +44,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class SessionAttributeAssertionTests { +class SessionAttributeAssertionTests { private final WebTestClient client = MockMvcWebTestClient.bindToController(new SimpleController()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/UrlAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/UrlAssertionTests.java index 92f673d9a6c..8beefa721f4 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/UrlAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/UrlAssertionTests.java @@ -33,7 +33,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class UrlAssertionTests { +class UrlAssertionTests { private final WebTestClient testClient = MockMvcWebTestClient.bindToController(new SimpleController()).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/ViewNameAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/ViewNameAssertionTests.java index 9004e5f67aa..44025836beb 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/ViewNameAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/ViewNameAssertionTests.java @@ -35,7 +35,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class ViewNameAssertionTests { +class ViewNameAssertionTests { private final WebTestClient client = MockMvcWebTestClient.bindToController(new SimpleController()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/XmlContentAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/XmlContentAssertionTests.java index bdb1338336d..ba3e9aafeca 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/XmlContentAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/XmlContentAssertionTests.java @@ -44,7 +44,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class XmlContentAssertionTests { +class XmlContentAssertionTests { private static final String PEOPLE_XML = "" + diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/XpathAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/XpathAssertionTests.java index 28f6253d30b..ca17a980995 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/XpathAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/resultmatches/XpathAssertionTests.java @@ -53,7 +53,7 @@ import static org.springframework.web.bind.annotation.RequestMethod.HEAD; * * @author Rossen Stoyanchev */ -public class XpathAssertionTests { +class XpathAssertionTests { private static final Map musicNamespace = Collections.singletonMap("ns", "https://example.org/music/people"); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/AsyncControllerJavaConfigTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/AsyncControllerJavaConfigTests.java index 7b4a2db3ec2..9873e103ba1 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/AsyncControllerJavaConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/AsyncControllerJavaConfigTests.java @@ -63,7 +63,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @WebAppConfiguration @ContextHierarchy(@ContextConfiguration(classes = AsyncControllerJavaConfigTests.WebConfig.class)) @DisabledInAotMode("@ContextHierarchy is not supported in AOT") -public class AsyncControllerJavaConfigTests { +class AsyncControllerJavaConfigTests { @Autowired private WebApplicationContext wac; @@ -75,7 +75,7 @@ public class AsyncControllerJavaConfigTests { @BeforeEach - public void setup() { + void setup() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/JavaConfigTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/JavaConfigTests.java index f612a63ea2a..78426c5de80 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/JavaConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/JavaConfigTests.java @@ -69,7 +69,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @ContextConfiguration(classes = WebConfig.class) }) @DisabledInAotMode("@ContextHierarchy is not supported in AOT") -public class JavaConfigTests { +class JavaConfigTests { @Autowired private WebApplicationContext wac; @@ -84,7 +84,7 @@ public class JavaConfigTests { @BeforeEach - public void setup() { + void setup() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); verifyRootWacSupport(); given(this.personDao.getPerson(5L)).willReturn(new Person("Joe")); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/WebAppResourceTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/WebAppResourceTests.java index 854a7ecd91a..07625bb22bd 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/WebAppResourceTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/WebAppResourceTests.java @@ -50,7 +50,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @ContextConfiguration("servlet-context.xml") }) @DisabledInAotMode("@ContextHierarchy is not supported in AOT") -public class WebAppResourceTests { +class WebAppResourceTests { @Autowired private WebApplicationContext wac; @@ -58,7 +58,7 @@ public class WebAppResourceTests { private MockMvc mockMvc; @BeforeEach - public void setup() { + void setup() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).alwaysExpect(status().isOk()).build(); } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/XmlConfigTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/XmlConfigTests.java index 92e66edbdf3..7921a61e7f1 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/XmlConfigTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/context/XmlConfigTests.java @@ -51,7 +51,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @ContextConfiguration("servlet-context.xml") }) @DisabledInAotMode("@ContextHierarchy is not supported in AOT") -public class XmlConfigTests { +class XmlConfigTests { @Autowired private WebApplicationContext wac; @@ -63,7 +63,7 @@ public class XmlConfigTests { @BeforeEach - public void setup() { + void setup() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); given(this.personDao.getPerson(5L)).willReturn(new Person("Joe")); } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/CustomRequestAttributesRequestContextHolderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/CustomRequestAttributesRequestContextHolderTests.java index ca1e086b564..c3b57382020 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/CustomRequestAttributesRequestContextHolderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/CustomRequestAttributesRequestContextHolderTests.java @@ -53,7 +53,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC * @since 4.2 * @see RequestContextHolderTests */ -public class CustomRequestAttributesRequestContextHolderTests { +class CustomRequestAttributesRequestContextHolderTests { private static final String FROM_CUSTOM_MOCK = "fromCustomMock"; private static final String FROM_MVC_TEST_DEFAULT = "fromSpringMvcTestDefault"; @@ -65,7 +65,7 @@ public class CustomRequestAttributesRequestContextHolderTests { @BeforeEach - public void setUp() { + void setUp() { ServletContext servletContext = new MockServletContext(); MockHttpServletRequest mockRequest = new MockHttpServletRequest(servletContext); mockRequest.setAttribute(FROM_CUSTOM_MOCK, FROM_CUSTOM_MOCK); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/EncodedUriTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/EncodedUriTests.java index 71cf0b04544..497fc465040 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/EncodedUriTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/EncodedUriTests.java @@ -54,7 +54,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC * @author Sebastien Deleuze */ @SpringJUnitWebConfig -public class EncodedUriTests { +class EncodedUriTests { private final MockMvc mockMvc; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/FormContentTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/FormContentTests.java index 14724fb43c2..3d3f9aea090 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/FormContentTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/FormContentTests.java @@ -33,7 +33,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class FormContentTests { +class FormContentTests { @Test // SPR-15753 void formContentIsNotDuplicated() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/HttpOptionsTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/HttpOptionsTests.java index 86e50ce47a5..79207f45baf 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/HttpOptionsTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/HttpOptionsTests.java @@ -43,7 +43,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC * @author Arnaud Cogoluègnes */ @SpringJUnitWebConfig -public class HttpOptionsTests { +class HttpOptionsTests { private final WebApplicationContext wac; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java index cefefc23a6a..c8a4cfe5bf9 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java @@ -72,7 +72,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC @WebAppConfiguration @ContextConfiguration @DirtiesContext -public class RequestContextHolderTests { +class RequestContextHolderTests { private static final String FROM_TCF_MOCK = "fromTestContextFrameworkMock"; private static final String FROM_MVC_TEST_DEFAULT = "fromSpringMvcTestDefault"; @@ -102,7 +102,7 @@ public class RequestContextHolderTests { @BeforeEach - public void setup() { + void setup() { this.mockRequest.setAttribute(FROM_TCF_MOCK, FROM_TCF_MOCK); this.mockMvc = webAppContextSetup(this.wac) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ApiVersionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ApiVersionTests.java index 10447d50b1b..262d42be1e7 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ApiVersionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ApiVersionTests.java @@ -41,7 +41,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * Tests demonstrating the use of API version. * @author Rossen Stoyanchev */ -public class ApiVersionTests { +class ApiVersionTests { @Test void queryParameter() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ExceptionHandlerTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ExceptionHandlerTests.java index 07cd8ef7a27..cd5dd602613 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ExceptionHandlerTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ExceptionHandlerTests.java @@ -42,7 +42,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @author Rossen Stoyanchev * @author Sam Brannen */ -public class ExceptionHandlerTests { +class ExceptionHandlerTests { @Nested class MvcTests { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java index 9f0454204f4..0297e0d5e76 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FilterTests.java @@ -65,7 +65,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * Tests with {@link Filter}'s. * @author Rob Winch */ -public class FilterTests { +class FilterTests { @Test void whenFiltersCompleteMvcProcessesRequest() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FrameworkExtensionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FrameworkExtensionTests.java index de2ba07bd01..69f3b617e3c 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FrameworkExtensionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/FrameworkExtensionTests.java @@ -50,7 +50,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @author Rossen Stoyanchev * @since 4.1 */ -public class FrameworkExtensionTests { +class FrameworkExtensionTests { private final MockMvc mockMvc = standaloneSetup(new SampleController()).apply(defaultSetup()).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ReactiveReturnTypeTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ReactiveReturnTypeTests.java index 3c66e97725d..5d310bb3f6e 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ReactiveReturnTypeTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ReactiveReturnTypeTests.java @@ -39,8 +39,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Rossen Stoyanchev */ -public class ReactiveReturnTypeTests { - +class ReactiveReturnTypeTests { @Test // SPR-16869 void sseWithFlux() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RedirectTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RedirectTests.java index 321d52e6a65..37347479e97 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RedirectTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RedirectTests.java @@ -45,13 +45,13 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @author Rossen Stoyanchev * @author Juergen Hoeller */ -public class RedirectTests { +class RedirectTests { private MockMvc mockMvc; @BeforeEach - public void setup() { + void setup() { this.mockMvc = standaloneSetup(new PersonController()).build(); } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RequestParameterTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RequestParameterTests.java index 5a7697f1bee..fe5965dfa64 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RequestParameterTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RequestParameterTests.java @@ -36,11 +36,10 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * * @author Rossen Stoyanchev */ -public class RequestParameterTests { +class RequestParameterTests { @Test void queryParameter() throws Exception { - standaloneSetup(new PersonController()).build() .perform(get("/search?name=George").accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RouterFunctionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RouterFunctionTests.java index 45ebce6ece5..f4b8fc71d9e 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RouterFunctionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/RouterFunctionTests.java @@ -45,7 +45,7 @@ import static org.springframework.web.servlet.function.ServerResponse.ok; /** * @author Arjen Poutsma */ -public class RouterFunctionTests { +class RouterFunctionTests { private MockMvc mockMvc = routerFunctions(testRoute()).defaultResponseCharacterEncoding(UTF_8).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resulthandlers/PrintingResultHandlerSmokeTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resulthandlers/PrintingResultHandlerSmokeTests.java index 2b84f93e520..13c5077ffb1 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resulthandlers/PrintingResultHandlerSmokeTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resulthandlers/PrintingResultHandlerSmokeTests.java @@ -48,7 +48,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @see org.springframework.test.web.servlet.result.PrintingResultHandlerTests */ @Disabled -public class PrintingResultHandlerSmokeTests { +class PrintingResultHandlerSmokeTests { // Not intended to be executed with the build. // Comment out class-level @Disabled to see the output. diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ContentAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ContentAssertionTests.java index 55a8520da14..57bf3aaac26 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ContentAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ContentAssertionTests.java @@ -43,7 +43,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @see XmlContentAssertionTests * @see XpathAssertionTests */ -public class ContentAssertionTests { +class ContentAssertionTests { private final MockMvc mockMvc = standaloneSetup(new SimpleController()).alwaysExpect(status().isOk()).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/CookieAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/CookieAssertionTests.java index 7260746bedf..62a0c6f2e40 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/CookieAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/CookieAssertionTests.java @@ -45,7 +45,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @author Rossen Stoyanchev * @author Nikola Yovchev */ -public class CookieAssertionTests { +class CookieAssertionTests { private static final String COOKIE_NAME = CookieLocaleResolver.DEFAULT_COOKIE_NAME; private static final String COOKIE_WITH_ATTRIBUTES_NAME = "SecondCookie"; @@ -55,7 +55,7 @@ public class CookieAssertionTests { @BeforeEach - public void setup() { + void setup() { CookieLocaleResolver localeResolver = new CookieLocaleResolver(); localeResolver.setCookieDomain("domain"); localeResolver.setCookieHttpOnly(true); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/FlashAttributeAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/FlashAttributeAssertionTests.java index 107a28b714a..81e5c52b0ac 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/FlashAttributeAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/FlashAttributeAssertionTests.java @@ -41,7 +41,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @author Rossen Stoyanchev * @author Sam Brannen */ -public class FlashAttributeAssertionTests { +class FlashAttributeAssertionTests { private final MockMvc mockMvc = standaloneSetup(new PersonController()) .alwaysExpect(status().isFound()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/HandlerAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/HandlerAssertionTests.java index 53d93d470c7..5184868c8d6 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/HandlerAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/HandlerAssertionTests.java @@ -42,7 +42,7 @@ import static org.springframework.web.servlet.mvc.method.annotation.MvcUriCompon * @author Rossen Stoyanchev * @author Sam Brannen */ -public class HandlerAssertionTests { +class HandlerAssertionTests { private final MockMvc mockMvc = standaloneSetup(new SimpleController()).alwaysExpect(status().isOk()).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/HeaderAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/HeaderAssertionTests.java index 45abb48a20c..37bb3b01b47 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/HeaderAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/HeaderAssertionTests.java @@ -57,7 +57,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @author Sam Brannen * @author Brian Clozel */ -public class HeaderAssertionTests { +class HeaderAssertionTests { private static final String ERROR_MESSAGE = "Should have thrown an AssertionError"; @@ -74,7 +74,7 @@ public class HeaderAssertionTests { @BeforeEach - public void setup() { + void setup() { this.dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); this.dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); this.now = dateFormat.format(new Date(this.currentTime)); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/JsonPathAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/JsonPathAssertionTests.java index e93a6ea7580..655754e8b04 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/JsonPathAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/JsonPathAssertionTests.java @@ -48,13 +48,13 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @author Rossen Stoyanchev * @see ContentAssertionTests */ -public class JsonPathAssertionTests { +class JsonPathAssertionTests { private MockMvc mockMvc; @BeforeEach - public void setup() { + void setup() { this.mockMvc = standaloneSetup(new MusicController()) .defaultRequest(get("/").accept(MediaType.APPLICATION_JSON)) .alwaysExpect(status().isOk()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ModelAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ModelAssertionTests.java index a4a79d9e9ee..3356dc01d6f 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ModelAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ModelAssertionTests.java @@ -48,7 +48,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * * @author Rossen Stoyanchev */ -public class ModelAssertionTests { +class ModelAssertionTests { private MockMvc mockMvc; diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/RequestAttributeAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/RequestAttributeAssertionTests.java index aeabf6cd065..7d3e54c46ca 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/RequestAttributeAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/RequestAttributeAssertionTests.java @@ -36,7 +36,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * * @author Rossen Stoyanchev */ -public class RequestAttributeAssertionTests { +class RequestAttributeAssertionTests { private final MockMvc mockMvc = standaloneSetup(new SimpleController()).build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/SessionAttributeAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/SessionAttributeAssertionTests.java index 2404a3d06ea..06c04c0892b 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/SessionAttributeAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/SessionAttributeAssertionTests.java @@ -43,7 +43,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @author Rossen Stoyanchev * @author Sam Brannen */ -public class SessionAttributeAssertionTests { +class SessionAttributeAssertionTests { private final MockMvc mockMvc = standaloneSetup(new SimpleController()) .defaultRequest(get("/")) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/UrlAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/UrlAssertionTests.java index 985da131183..9ef652c0bfb 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/UrlAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/UrlAssertionTests.java @@ -35,12 +35,12 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * * @author Rossen Stoyanchev */ -public class UrlAssertionTests { +class UrlAssertionTests { private MockMvc mockMvc; @BeforeEach - public void setup() { + void setup() { this.mockMvc = standaloneSetup(new SimpleController()).build(); } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ViewNameAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ViewNameAssertionTests.java index a88f003f8e7..d838c387faf 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ViewNameAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ViewNameAssertionTests.java @@ -35,12 +35,12 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * * @author Rossen Stoyanchev */ -public class ViewNameAssertionTests { +class ViewNameAssertionTests { private MockMvc mockMvc; @BeforeEach - public void setup() { + void setup() { this.mockMvc = standaloneSetup(new SimpleController()) .alwaysExpect(status().isOk()) .build(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/XmlContentAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/XmlContentAssertionTests.java index 2ed94557033..d4bb5c7be9d 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/XmlContentAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/XmlContentAssertionTests.java @@ -48,7 +48,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal * @see ContentAssertionTests * @see XpathAssertionTests */ -public class XmlContentAssertionTests { +class XmlContentAssertionTests { private static final String PEOPLE_XML = "" + @@ -63,7 +63,7 @@ public class XmlContentAssertionTests { @BeforeEach - public void setup() { + void setup() { this.mockMvc = standaloneSetup(new MusicController()) .defaultRequest(get("/").accept(MediaType.APPLICATION_XML, MediaType.parseMediaType("application/xml;charset=UTF-8"))) .alwaysExpect(status().isOk()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/XpathAssertionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/XpathAssertionTests.java index a6d17bfda4c..0bcd2f6a456 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/XpathAssertionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/XpathAssertionTests.java @@ -57,7 +57,7 @@ import static org.springframework.web.bind.annotation.RequestMethod.HEAD; * @see ContentAssertionTests * @see XmlContentAssertionTests */ -public class XpathAssertionTests { +class XpathAssertionTests { private static final Map musicNamespace = Collections.singletonMap("ns", "https://example.org/music/people"); @@ -65,7 +65,7 @@ public class XpathAssertionTests { private MockMvc mockMvc; @BeforeEach - public void setup() throws Exception { + void setup() throws Exception { this.mockMvc = standaloneSetup(new MusicController()) .defaultRequest(get("/").accept(MediaType.APPLICATION_XML, MediaType.parseMediaType("application/xml;charset=UTF-8"))) .alwaysExpect(status().isOk()) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/DefaultMockMvcBuilderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/setup/DefaultMockMvcBuilderTests.java index 73c7ed16b5f..cd86e9f07c5 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/DefaultMockMvcBuilderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/setup/DefaultMockMvcBuilderTests.java @@ -39,7 +39,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC * @author Sam Brannen * @author Stephane Nicoll */ -public class DefaultMockMvcBuilderTests { +class DefaultMockMvcBuilderTests { private final MockServletContext servletContext = new MockServletContext(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/MockMvcFilterDecoratorTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/setup/MockMvcFilterDecoratorTests.java index ab9c3c529f6..db753e8df0c 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/MockMvcFilterDecoratorTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/setup/MockMvcFilterDecoratorTests.java @@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Rob Winch * @author Rossen Stoyanchev */ -public class MockMvcFilterDecoratorTests { +class MockMvcFilterDecoratorTests { private MockHttpServletRequest request; @@ -54,7 +54,7 @@ public class MockMvcFilterDecoratorTests { @BeforeEach - public void setup() { + void setup() { request = new MockHttpServletRequest(); request.setContextPath("/context"); response = new MockHttpServletResponse(); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/SharedHttpSessionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/setup/SharedHttpSessionTests.java index 95f599089bb..ff5bfde9552 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/setup/SharedHttpSessionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/setup/SharedHttpSessionTests.java @@ -34,7 +34,7 @@ import static org.springframework.test.web.servlet.setup.SharedHttpSessionConfig * * @author Rossen Stoyanchev */ -public class SharedHttpSessionTests { +class SharedHttpSessionTests { @Test void httpSession() throws Exception { diff --git a/spring-test/src/test/java/org/springframework/test/web/support/CookieAssertionsTests.java b/spring-test/src/test/java/org/springframework/test/web/support/CookieAssertionsTests.java index 0f75ce95e1c..3bafad08b03 100644 --- a/spring-test/src/test/java/org/springframework/test/web/support/CookieAssertionsTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/support/CookieAssertionsTests.java @@ -37,7 +37,7 @@ import static org.hamcrest.Matchers.equalTo; * @author Rob Worsnop * @author Rossen Stoyanchev */ -public class CookieAssertionsTests { +class CookieAssertionsTests { private TestCookieAssertions assertions; diff --git a/spring-web/src/test/java/org/springframework/http/client/SimpleClientHttpRequestFactoryTests.java b/spring-web/src/test/java/org/springframework/http/client/SimpleClientHttpRequestFactoryTests.java index 9276f4f1f2d..b1bfea26c40 100644 --- a/spring-web/src/test/java/org/springframework/http/client/SimpleClientHttpRequestFactoryTests.java +++ b/spring-web/src/test/java/org/springframework/http/client/SimpleClientHttpRequestFactoryTests.java @@ -38,7 +38,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -public class SimpleClientHttpRequestFactoryTests extends AbstractHttpRequestFactoryTests { +class SimpleClientHttpRequestFactoryTests extends AbstractHttpRequestFactoryTests { @Override protected ClientHttpRequestFactory createRequestFactory() { diff --git a/spring-web/src/test/java/org/springframework/http/codec/ResourceHttpMessageWriterTests.java b/spring-web/src/test/java/org/springframework/http/codec/ResourceHttpMessageWriterTests.java index 436513a3fb6..1a5cf25130d 100644 --- a/spring-web/src/test/java/org/springframework/http/codec/ResourceHttpMessageWriterTests.java +++ b/spring-web/src/test/java/org/springframework/http/codec/ResourceHttpMessageWriterTests.java @@ -63,7 +63,7 @@ class ResourceHttpMessageWriterTests { @Test @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getWritableMediaTypes() { + void getWritableMediaTypes() { assertThat((List) this.writer.getWritableMediaTypes()) .containsExactlyInAnyOrder(MimeTypeUtils.APPLICATION_OCTET_STREAM, MimeTypeUtils.ALL); } diff --git a/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJackson2JsonEncoderTests.java b/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJackson2JsonEncoderTests.java index 1753924db30..89e6fe567e2 100644 --- a/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJackson2JsonEncoderTests.java +++ b/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJackson2JsonEncoderTests.java @@ -50,7 +50,7 @@ class CustomizedJackson2JsonEncoderTests extends AbstractEncoderTests input = Flux.just( new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL1), new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL2) diff --git a/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJacksonJsonDecoderTests.java b/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJacksonJsonDecoderTests.java index c0dfcb6d75f..64630d088a5 100644 --- a/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJacksonJsonDecoderTests.java +++ b/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJacksonJsonDecoderTests.java @@ -50,7 +50,7 @@ class CustomizedJacksonJsonDecoderTests extends AbstractDecoderTests input = Flux.concat(stringBuffer("{\"property\":\"Value1\"}")); testDecodeAll(input, MyCustomizedDecoderBean.class, step -> step @@ -60,7 +60,7 @@ class CustomizedJacksonJsonDecoderTests extends AbstractDecoderTests input = stringBuffer("{\"property\":\"Value2\"}"); ResolvableType elementType = ResolvableType.forClass(MyCustomizedDecoderBean.class); diff --git a/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJacksonJsonEncoderTests.java b/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJacksonJsonEncoderTests.java index 5655fd55381..8dad0f44f00 100644 --- a/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJacksonJsonEncoderTests.java +++ b/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJacksonJsonEncoderTests.java @@ -49,7 +49,7 @@ class CustomizedJacksonJsonEncoderTests extends AbstractEncoderTests input = Flux.just( new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL1), new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL2) diff --git a/spring-web/src/test/java/org/springframework/http/codec/json/Jackson2JsonDecoderTests.java b/spring-web/src/test/java/org/springframework/http/codec/json/Jackson2JsonDecoderTests.java index 4e426563844..0894f085963 100644 --- a/spring-web/src/test/java/org/springframework/http/codec/json/Jackson2JsonDecoderTests.java +++ b/spring-web/src/test/java/org/springframework/http/codec/json/Jackson2JsonDecoderTests.java @@ -76,7 +76,7 @@ class Jackson2JsonDecoderTests extends AbstractDecoderTests @Override @Test - public void canDecode() { + protected void canDecode() { assertThat(decoder.canDecode(ResolvableType.forClass(Pojo.class), APPLICATION_JSON)).isTrue(); assertThat(decoder.canDecode(ResolvableType.forClass(Pojo.class), APPLICATION_NDJSON)).isTrue(); assertThat(decoder.canDecode(ResolvableType.forClass(Pojo.class), null)).isTrue(); diff --git a/spring-web/src/test/java/org/springframework/http/codec/protobuf/ProtobufJsonDecoderTests.java b/spring-web/src/test/java/org/springframework/http/codec/protobuf/ProtobufJsonDecoderTests.java index 9d36ecb1af6..fb6a3b68509 100644 --- a/spring-web/src/test/java/org/springframework/http/codec/protobuf/ProtobufJsonDecoderTests.java +++ b/spring-web/src/test/java/org/springframework/http/codec/protobuf/ProtobufJsonDecoderTests.java @@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat; * Tests for {@link ProtobufJsonDecoder}. * @author Brian Clozel */ -public class ProtobufJsonDecoderTests extends AbstractDecoderTests { +class ProtobufJsonDecoderTests extends AbstractDecoderTests { private Msg msg1 = Msg.newBuilder().setFoo("Foo").setBlah(SecondMsg.newBuilder().setBlah(123).build()).build(); diff --git a/spring-web/src/test/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBeanTests.java b/spring-web/src/test/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBeanTests.java index 8a35b2014a5..d288cf63019 100644 --- a/spring-web/src/test/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBeanTests.java +++ b/spring-web/src/test/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBeanTests.java @@ -74,7 +74,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException * @author Sam Brannen */ @SuppressWarnings({"deprecation", "removal" }) -public class Jackson2ObjectMapperFactoryBeanTests { +class Jackson2ObjectMapperFactoryBeanTests { private static final String DATE_FORMAT = "yyyy-MM-dd"; diff --git a/spring-web/src/test/java/org/springframework/http/server/ServletRequestHeadersAdapterTests.java b/spring-web/src/test/java/org/springframework/http/server/ServletRequestHeadersAdapterTests.java index 560d5410efe..2e5b5098140 100644 --- a/spring-web/src/test/java/org/springframework/http/server/ServletRequestHeadersAdapterTests.java +++ b/spring-web/src/test/java/org/springframework/http/server/ServletRequestHeadersAdapterTests.java @@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat; /** * Unit tests for {@link ServletRequestHeadersAdapter}. */ -public class ServletRequestHeadersAdapterTests { +class ServletRequestHeadersAdapterTests { private final MockHttpServletRequest request = new MockHttpServletRequest(); diff --git a/spring-web/src/test/java/org/springframework/web/accept/DefaultApiVersionStrategiesTests.java b/spring-web/src/test/java/org/springframework/web/accept/DefaultApiVersionStrategiesTests.java index 4bf44c79374..094452b3140 100644 --- a/spring-web/src/test/java/org/springframework/web/accept/DefaultApiVersionStrategiesTests.java +++ b/spring-web/src/test/java/org/springframework/web/accept/DefaultApiVersionStrategiesTests.java @@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; * Unit tests for {@link DefaultApiVersionStrategy}. * @author Rossen Stoyanchev */ -public class DefaultApiVersionStrategiesTests { +class DefaultApiVersionStrategiesTests { private static final SemanticApiVersionParser parser = new SemanticApiVersionParser(); diff --git a/spring-web/src/test/java/org/springframework/web/accept/MediaTypeParamApiVersionResolverTests.java b/spring-web/src/test/java/org/springframework/web/accept/MediaTypeParamApiVersionResolverTests.java index 6f77dfba367..2385d977ffb 100644 --- a/spring-web/src/test/java/org/springframework/web/accept/MediaTypeParamApiVersionResolverTests.java +++ b/spring-web/src/test/java/org/springframework/web/accept/MediaTypeParamApiVersionResolverTests.java @@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat; * Unit tests for {@link MediaTypeParamApiVersionResolver}. * @author Rossen Stoyanchev */ -public class MediaTypeParamApiVersionResolverTests { +class MediaTypeParamApiVersionResolverTests { private final MediaType mediaType = MediaType.parseMediaType("application/x.abc+json"); diff --git a/spring-web/src/test/java/org/springframework/web/accept/PathApiVersionResolverTests.java b/spring-web/src/test/java/org/springframework/web/accept/PathApiVersionResolverTests.java index ac82703d073..b0d36773264 100644 --- a/spring-web/src/test/java/org/springframework/web/accept/PathApiVersionResolverTests.java +++ b/spring-web/src/test/java/org/springframework/web/accept/PathApiVersionResolverTests.java @@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; * Unit tests for {@link PathApiVersionResolver}. * @author Rossen Stoyanchev */ -public class PathApiVersionResolverTests { +class PathApiVersionResolverTests { @Test void resolve() { diff --git a/spring-web/src/test/java/org/springframework/web/accept/QueryApiVersionResolverTests.java b/spring-web/src/test/java/org/springframework/web/accept/QueryApiVersionResolverTests.java index 62886a78997..ea7d48f028f 100644 --- a/spring-web/src/test/java/org/springframework/web/accept/QueryApiVersionResolverTests.java +++ b/spring-web/src/test/java/org/springframework/web/accept/QueryApiVersionResolverTests.java @@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat; * Unit tests for {@link QueryApiVersionResolver}. * @author Rossen Stoyanchev */ -public class QueryApiVersionResolverTests { +class QueryApiVersionResolverTests { private final String queryParamName = "api-version"; diff --git a/spring-web/src/test/java/org/springframework/web/accept/SemanticApiVersionParserTests.java b/spring-web/src/test/java/org/springframework/web/accept/SemanticApiVersionParserTests.java index d98a910a564..4cee6e74017 100644 --- a/spring-web/src/test/java/org/springframework/web/accept/SemanticApiVersionParserTests.java +++ b/spring-web/src/test/java/org/springframework/web/accept/SemanticApiVersionParserTests.java @@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; * Unit tests for {@link SemanticApiVersionParser}. * @author Rossen Stoyanchev */ -public class SemanticApiVersionParserTests { +class SemanticApiVersionParserTests { private final SemanticApiVersionParser parser = new SemanticApiVersionParser(); diff --git a/spring-web/src/test/java/org/springframework/web/accept/StandardApiVersionDeprecationHandlerTests.java b/spring-web/src/test/java/org/springframework/web/accept/StandardApiVersionDeprecationHandlerTests.java index be96b91f384..22db017df70 100644 --- a/spring-web/src/test/java/org/springframework/web/accept/StandardApiVersionDeprecationHandlerTests.java +++ b/spring-web/src/test/java/org/springframework/web/accept/StandardApiVersionDeprecationHandlerTests.java @@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat; * Unit tests for {@link StandardApiVersionDeprecationHandler}. * @author Rossen Stoyanchev */ -public class StandardApiVersionDeprecationHandlerTests { +class StandardApiVersionDeprecationHandlerTests { private final MockHttpServletRequest request = new MockHttpServletRequest(); diff --git a/spring-web/src/test/java/org/springframework/web/client/RestClientBuilderTests.java b/spring-web/src/test/java/org/springframework/web/client/RestClientBuilderTests.java index 7dda5d1a746..6f5550ce6a8 100644 --- a/spring-web/src/test/java/org/springframework/web/client/RestClientBuilderTests.java +++ b/spring-web/src/test/java/org/springframework/web/client/RestClientBuilderTests.java @@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.fail; * @author Sebastien Deleuze * @author Nicklas Wiegandt */ -public class RestClientBuilderTests { +class RestClientBuilderTests { @SuppressWarnings("unchecked") @Test diff --git a/spring-web/src/test/java/org/springframework/web/client/RestClientVersionTests.java b/spring-web/src/test/java/org/springframework/web/client/RestClientVersionTests.java index 40890e93b29..12091f71f58 100644 --- a/spring-web/src/test/java/org/springframework/web/client/RestClientVersionTests.java +++ b/spring-web/src/test/java/org/springframework/web/client/RestClientVersionTests.java @@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; * {@link RestClient} tests for sending API versions. * @author Rossen Stoyanchev */ -public class RestClientVersionTests { +class RestClientVersionTests { private final MockWebServer server = new MockWebServer(); diff --git a/spring-web/src/test/java/org/springframework/web/client/support/RestClientProxyRegistryIntegrationTests.java b/spring-web/src/test/java/org/springframework/web/client/support/RestClientProxyRegistryIntegrationTests.java index 1d415f724c1..17ea2ff8933 100644 --- a/spring-web/src/test/java/org/springframework/web/client/support/RestClientProxyRegistryIntegrationTests.java +++ b/spring-web/src/test/java/org/springframework/web/client/support/RestClientProxyRegistryIntegrationTests.java @@ -48,7 +48,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Rossen Stoyanchev */ -public class RestClientProxyRegistryIntegrationTests { +class RestClientProxyRegistryIntegrationTests { private final MockWebServer server = new MockWebServer(); diff --git a/spring-web/src/test/java/org/springframework/web/context/request/async/AsyncRequestNotUsableTests.java b/spring-web/src/test/java/org/springframework/web/context/request/async/AsyncRequestNotUsableTests.java index 3715560b896..2ac18df3be5 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/async/AsyncRequestNotUsableTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/async/AsyncRequestNotUsableTests.java @@ -47,7 +47,7 @@ import static org.mockito.Mockito.verifyNoInteractions; * * @author Rossen Stoyanchev */ -public class AsyncRequestNotUsableTests { +class AsyncRequestNotUsableTests { private final MockHttpServletRequest request = new MockHttpServletRequest(); diff --git a/spring-web/src/test/java/org/springframework/web/filter/OncePerRequestFilterTests.java b/spring-web/src/test/java/org/springframework/web/filter/OncePerRequestFilterTests.java index 2a2c85be235..81277ea6c17 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/OncePerRequestFilterTests.java +++ b/spring-web/src/test/java/org/springframework/web/filter/OncePerRequestFilterTests.java @@ -51,7 +51,7 @@ class OncePerRequestFilterTests { @BeforeEach @SuppressWarnings("serial") - public void setup() throws Exception { + void setup() throws Exception { this.request = new MockHttpServletRequest(); this.request.setScheme("http"); this.request.setServerName("localhost"); diff --git a/spring-web/src/test/java/org/springframework/web/filter/UrlHandlerFilterTests.java b/spring-web/src/test/java/org/springframework/web/filter/UrlHandlerFilterTests.java index e020527fb1f..d8ed4ba81d9 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/UrlHandlerFilterTests.java +++ b/spring-web/src/test/java/org/springframework/web/filter/UrlHandlerFilterTests.java @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Rossen Stoyanchev */ -public class UrlHandlerFilterTests { +class UrlHandlerFilterTests { @Test void requestWrapping() throws Exception { diff --git a/spring-web/src/test/java/org/springframework/web/filter/reactive/UrlHandlerFilterTests.java b/spring-web/src/test/java/org/springframework/web/filter/reactive/UrlHandlerFilterTests.java index 14a8e40440b..c3cc1e65554 100644 --- a/spring-web/src/test/java/org/springframework/web/filter/reactive/UrlHandlerFilterTests.java +++ b/spring-web/src/test/java/org/springframework/web/filter/reactive/UrlHandlerFilterTests.java @@ -42,7 +42,7 @@ import static org.mockito.Mockito.mock; * * @author Rossen Stoyanchev */ -public class UrlHandlerFilterTests { +class UrlHandlerFilterTests { @Test void requestMutation() { diff --git a/spring-web/src/test/java/org/springframework/web/method/annotation/ExpressionValueMethodArgumentResolverTests.java b/spring-web/src/test/java/org/springframework/web/method/annotation/ExpressionValueMethodArgumentResolverTests.java index 8456182ef0d..b0026d011f6 100644 --- a/spring-web/src/test/java/org/springframework/web/method/annotation/ExpressionValueMethodArgumentResolverTests.java +++ b/spring-web/src/test/java/org/springframework/web/method/annotation/ExpressionValueMethodArgumentResolverTests.java @@ -51,7 +51,7 @@ class ExpressionValueMethodArgumentResolverTests { private NativeWebRequest webRequest; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { GenericWebApplicationContext context = new GenericWebApplicationContext(); context.refresh(); resolver = new ExpressionValueMethodArgumentResolver(context.getBeanFactory()); diff --git a/spring-web/src/test/java/org/springframework/web/service/invoker/HttpServiceProxyFactoryTests.java b/spring-web/src/test/java/org/springframework/web/service/invoker/HttpServiceProxyFactoryTests.java index 75c3e6f731f..a6f55225c16 100644 --- a/spring-web/src/test/java/org/springframework/web/service/invoker/HttpServiceProxyFactoryTests.java +++ b/spring-web/src/test/java/org/springframework/web/service/invoker/HttpServiceProxyFactoryTests.java @@ -31,7 +31,7 @@ import static org.mockito.Mockito.mock; * * @author Rossen Stoyanchev */ -public class HttpServiceProxyFactoryTests { +class HttpServiceProxyFactoryTests { @Test void httpExchangeAdapterDecorator() { diff --git a/spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBeanTests.java b/spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBeanTests.java index 18ee7b3dae5..2db1578c4dc 100644 --- a/spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBeanTests.java +++ b/spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBeanTests.java @@ -53,7 +53,7 @@ import static org.springframework.web.service.registry.HttpServiceGroup.ClientTy * Unit tests for {@link HttpServiceProxyRegistryFactoryBean}. * @author Rossen Stoyanchev */ -public class HttpServiceProxyRegistryFactoryBeanTests { +class HttpServiceProxyRegistryFactoryBeanTests { @Test void twoGroups() { diff --git a/spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceRegistrarTests.java b/spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceRegistrarTests.java index 35ef88180e4..29e38cadc20 100644 --- a/spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceRegistrarTests.java +++ b/spring-web/src/test/java/org/springframework/web/service/registry/HttpServiceRegistrarTests.java @@ -42,7 +42,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException * @author Rossen Stoyanchev */ @SuppressWarnings("unchecked") -public class HttpServiceRegistrarTests { +class HttpServiceRegistrarTests { private static final String ECHO_GROUP = "echo"; diff --git a/spring-web/src/test/java/org/springframework/web/service/registry/ImportHttpServiceRegistrarTests.java b/spring-web/src/test/java/org/springframework/web/service/registry/ImportHttpServiceRegistrarTests.java index 8959cb2f2de..ef789d29601 100644 --- a/spring-web/src/test/java/org/springframework/web/service/registry/ImportHttpServiceRegistrarTests.java +++ b/spring-web/src/test/java/org/springframework/web/service/registry/ImportHttpServiceRegistrarTests.java @@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Rossen Stoyanchev * @author Stephane Nicoll */ -public class ImportHttpServiceRegistrarTests { +class ImportHttpServiceRegistrarTests { private static final String ECHO_GROUP = "echo"; diff --git a/spring-web/src/test/java/org/springframework/web/util/DisconnectedClientHelperTests.java b/spring-web/src/test/java/org/springframework/web/util/DisconnectedClientHelperTests.java index fa4b2d18894..c0ff6ecc39d 100644 --- a/spring-web/src/test/java/org/springframework/web/util/DisconnectedClientHelperTests.java +++ b/spring-web/src/test/java/org/springframework/web/util/DisconnectedClientHelperTests.java @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; * Unit tests for {@link DisconnectedClientHelper}. * @author Rossen Stoyanchev */ -public class DisconnectedClientHelperTests { +class DisconnectedClientHelperTests { @ParameterizedTest @ValueSource(strings = {"broKen pipe", "connection reset By peer"}) diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java index 5eecee6bf8b..2bf549cb543 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java @@ -72,7 +72,7 @@ import static org.springframework.http.MediaType.APPLICATION_JSON; * @author Rossen Stoyanchev */ @SuppressWarnings({"ThrowableResultOfMethodCallIgnored", "ThrowableInstanceNeverThrown"}) -public class DispatcherHandlerErrorTests { +class DispatcherHandlerErrorTests { private static final IllegalStateException EXCEPTION = new IllegalStateException("boo"); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/accept/DefaultApiVersionStrategiesTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/accept/DefaultApiVersionStrategiesTests.java index 99015f12f41..f8b2c7c8889 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/accept/DefaultApiVersionStrategiesTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/accept/DefaultApiVersionStrategiesTests.java @@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException * @author Rossen Stoyanchev * @author Jonathan Kaplan */ -public class DefaultApiVersionStrategiesTests { +class DefaultApiVersionStrategiesTests { private static final SemanticApiVersionParser parser = new SemanticApiVersionParser(); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/accept/MediaTypeParamApiVersionResolverTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/accept/MediaTypeParamApiVersionResolverTests.java index f7b47da0ec5..e9042b120a3 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/accept/MediaTypeParamApiVersionResolverTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/accept/MediaTypeParamApiVersionResolverTests.java @@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat; * Unit tests for {@link MediaTypeParamApiVersionResolver}. * @author Rossen Stoyanchev */ -public class MediaTypeParamApiVersionResolverTests { +class MediaTypeParamApiVersionResolverTests { private final MediaType mediaType = MediaType.parseMediaType("application/x.abc+json"); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/accept/PathApiVersionResolverTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/accept/PathApiVersionResolverTests.java index bbd88535db1..d0ca19dbca4 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/accept/PathApiVersionResolverTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/accept/PathApiVersionResolverTests.java @@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; * @author Rossen Stoyanchev * @author Martin Mois */ -public class PathApiVersionResolverTests { +class PathApiVersionResolverTests { @Test void resolve() { diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/accept/StandardApiVersionDeprecationHandlerTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/accept/StandardApiVersionDeprecationHandlerTests.java index 81947509347..4e7724a9a02 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/accept/StandardApiVersionDeprecationHandlerTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/accept/StandardApiVersionDeprecationHandlerTests.java @@ -34,7 +34,7 @@ import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; * Unit tests for {@link StandardApiVersionDeprecationHandler}. * @author Rossen Stoyanchev */ -public class StandardApiVersionDeprecationHandlerTests { +class StandardApiVersionDeprecationHandlerTests { private final ServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/").build()); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/config/DelegatingWebFluxConfigurationTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/config/DelegatingWebFluxConfigurationTests.java index bf85f4d32ee..4186e8123f1 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/config/DelegatingWebFluxConfigurationTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/config/DelegatingWebFluxConfigurationTests.java @@ -56,7 +56,7 @@ import static org.mockito.Mockito.verify; * @author Brian Clozel */ @MockitoSettings(strictness = Strictness.LENIENT) -public class DelegatingWebFluxConfigurationTests { +class DelegatingWebFluxConfigurationTests { @Mock private WebFluxConfigurer webFluxConfigurer; diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultWebClientTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultWebClientTests.java index 0a20c2e7b30..930fea9a86c 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultWebClientTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultWebClientTests.java @@ -61,7 +61,7 @@ import static org.mockito.Mockito.when; * @author Brian Clozel */ @MockitoSettings(strictness = Strictness.LENIENT) -public class DefaultWebClientTests { +class DefaultWebClientTests { @Mock private ExchangeFunction exchangeFunction; diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientVersionTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientVersionTests.java index 367d6038bf1..40d202d29ca 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientVersionTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientVersionTests.java @@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; * {@link WebClient} tests for sending API versions. * @author Rossen Stoyanchev */ -public class WebClientVersionTests { +class WebClientVersionTests { private final MockWebServer server = new MockWebServer(); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientProxyRegistryIntegrationTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientProxyRegistryIntegrationTests.java index 689ddad69b7..8292a66beb2 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientProxyRegistryIntegrationTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientProxyRegistryIntegrationTests.java @@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Rossen Stoyanchev */ -public class WebClientProxyRegistryIntegrationTests { +class WebClientProxyRegistryIntegrationTests { private final MockWebServer server = new MockWebServer(); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/function/server/support/RouterFunctionMappingVersionTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/function/server/support/RouterFunctionMappingVersionTests.java index 1a07389da41..07a4d205ab9 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/function/server/support/RouterFunctionMappingVersionTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/function/server/support/RouterFunctionMappingVersionTests.java @@ -44,7 +44,7 @@ import static org.springframework.web.reactive.function.server.RequestPredicates * {@link RouterFunctionMapping} integration tests for API versioning. * @author Rossen Stoyanchev */ -public class RouterFunctionMappingVersionTests { +class RouterFunctionMappingVersionTests { private RouterFunctionMapping mapping; diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/resource/CachingResourceResolverTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/resource/CachingResourceResolverTests.java index 347ab0a4df4..bbf06665b89 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/resource/CachingResourceResolverTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/resource/CachingResourceResolverTests.java @@ -41,7 +41,7 @@ import static org.springframework.web.testfixture.http.server.reactive.MockServe * @author Rossen Stoyanchev */ @ExtendWith(GzipSupport.class) -public class CachingResourceResolverTests { +class CachingResourceResolverTests { private static final Duration TIMEOUT = Duration.ofSeconds(5); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/resource/EncodedResourceResolverTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/resource/EncodedResourceResolverTests.java index 2696f99e6af..81837a85ef4 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/resource/EncodedResourceResolverTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/resource/EncodedResourceResolverTests.java @@ -42,7 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Rossen Stoyanchev */ @ExtendWith(GzipSupport.class) -public class EncodedResourceResolverTests { +class EncodedResourceResolverTests { private static final Duration TIMEOUT = Duration.ofSeconds(5); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/condition/VersionRequestConditionTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/condition/VersionRequestConditionTests.java index 3267cb89074..c2849c47a60 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/condition/VersionRequestConditionTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/condition/VersionRequestConditionTests.java @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; * Unit tests for {@link VersionRequestCondition}. * @author Rossen Stoyanchev */ -public class VersionRequestConditionTests { +class VersionRequestConditionTests { private DefaultApiVersionStrategy strategy; diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ControllerAdviceTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ControllerAdviceTests.java index 1a07ec1354e..06ca7725253 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ControllerAdviceTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ControllerAdviceTests.java @@ -86,7 +86,7 @@ class ControllerAdviceTests { } @Test // SPR-12605 - public void resolveExceptionWithHandlerMethodArg() throws Exception { + void resolveExceptionWithHandlerMethodArg() throws Exception { testException(new ArrayIndexOutOfBoundsException(), "HandlerMethod: handle"); } diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingVersionIntegrationTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingVersionIntegrationTests.java index f155b983ec3..032007d7e5d 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingVersionIntegrationTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingVersionIntegrationTests.java @@ -43,7 +43,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; * {@code @RequestMapping} integration focusing on API versioning. * @author Rossen Stoyanchev */ -public class RequestMappingVersionIntegrationTests extends AbstractRequestMappingIntegrationTests { +class RequestMappingVersionIntegrationTests extends AbstractRequestMappingIntegrationTests { @Override protected ApplicationContext initApplicationContext() { diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ServerWebExchangeMethodArgumentResolverTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ServerWebExchangeMethodArgumentResolverTests.java index 8400ca5a30f..52dae9c1dc1 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ServerWebExchangeMethodArgumentResolverTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ServerWebExchangeMethodArgumentResolverTests.java @@ -102,7 +102,7 @@ class ServerWebExchangeMethodArgumentResolverTests { } @Test // gh-25822 - public void resolveUriComponentsBuilderWithContextPath() { + void resolveUriComponentsBuilderWithContextPath() { ServerWebExchange exchange = MockServerWebExchange.from( MockServerHttpRequest.get("https://example.org:9999/app/path?q=foo").contextPath("/app")); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/FragmentTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/FragmentTests.java index 4367cb15357..44cc58d1d93 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/FragmentTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/FragmentTests.java @@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat; * Unit tests for {@link Fragment}. * @author Rossen Stoyanchev */ -public class FragmentTests { +class FragmentTests { @Test void mergeAttributes() { diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/FragmentViewResolutionResultHandlerTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/FragmentViewResolutionResultHandlerTests.java index 457ad0f0774..7a9ff80abbf 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/FragmentViewResolutionResultHandlerTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/FragmentViewResolutionResultHandlerTests.java @@ -56,7 +56,7 @@ import static org.springframework.web.testfixture.method.ResolvableMethod.on; * @author Rossen Stoyanchev * @author Sebastien Deleuze */ -public class FragmentViewResolutionResultHandlerTests { +class FragmentViewResolutionResultHandlerTests { private static final Fragment fragment1 = Fragment.create("fragment1", Map.of("foo", "Foo")); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/script/ScriptTemplateViewTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/script/ScriptTemplateViewTests.java index ce974de2705..155b77a1344 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/script/ScriptTemplateViewTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/view/script/ScriptTemplateViewTests.java @@ -46,7 +46,7 @@ import static org.mockito.Mockito.mock; * * @author Sebastien Deleuze */ -public class ScriptTemplateViewTests { +class ScriptTemplateViewTests { private ScriptTemplateView view; @@ -56,7 +56,7 @@ public class ScriptTemplateViewTests { @BeforeEach - public void setup() { + void setup() { this.configurer = new ScriptTemplateConfigurer(); this.context = new StaticApplicationContext(); this.context.getBeanFactory().registerSingleton("scriptTemplateConfigurer", this.configurer); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/MvcNamespaceTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/MvcNamespaceTests.java index cfbdf858af0..3de64e17c6b 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/MvcNamespaceTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/MvcNamespaceTests.java @@ -163,7 +163,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; */ @SuppressWarnings("deprecation") -public class MvcNamespaceTests { +class MvcNamespaceTests { public static final String VIEWCONTROLLER_BEAN_NAME = "org.springframework.web.servlet.config.viewControllerHandlerMapping"; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfigurationTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfigurationTests.java index 698bf33e186..70694c3d29e 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfigurationTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfigurationTests.java @@ -62,7 +62,7 @@ import static org.mockito.Mockito.verify; * @author Rossen Stoyanchev */ @ExtendWith(MockitoExtension.class) -public class DelegatingWebMvcConfigurationTests { +class DelegatingWebMvcConfigurationTests { @Mock private WebMvcConfigurer webMvcConfigurer; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/InterceptorRegistryTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/InterceptorRegistryTests.java index 64cc84c60d3..da3c3d74fe6 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/InterceptorRegistryTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/InterceptorRegistryTests.java @@ -51,7 +51,7 @@ import static org.mockito.Mockito.mock; * @author Eko Kurniawan Khannedy */ @SuppressWarnings("deprecation") -public class InterceptorRegistryTests { +class InterceptorRegistryTests { private InterceptorRegistry registry; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/function/support/HandlerFunctionAdapterTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/function/support/HandlerFunctionAdapterTests.java index 69845e59ec9..6f1bbf20282 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/function/support/HandlerFunctionAdapterTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/function/support/HandlerFunctionAdapterTests.java @@ -46,7 +46,7 @@ import static org.mockito.Mockito.mock; * * @author Rossen Stoyanchev */ -public class HandlerFunctionAdapterTests { +class HandlerFunctionAdapterTests { private final MockHttpServletRequest servletRequest = new MockHttpServletRequest("GET", "/"); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/function/support/RouterFunctionMappingVersionTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/function/support/RouterFunctionMappingVersionTests.java index d6afa45c483..5cba3dab49c 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/function/support/RouterFunctionMappingVersionTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/function/support/RouterFunctionMappingVersionTests.java @@ -45,7 +45,7 @@ import static org.springframework.web.servlet.function.RequestPredicates.version * {@link RouterFunctionMapping} integration tests for API versioning. * @author Rossen Stoyanchev */ -public class RouterFunctionMappingVersionTests { +class RouterFunctionMappingVersionTests { private final MockServletContext servletContext = new MockServletContext(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java index 668407d0214..953594f6d14 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java @@ -56,7 +56,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; * @author Rossen Stoyanchev */ @SuppressWarnings("unused") -public class HandlerMethodMappingTests { +class HandlerMethodMappingTests { private MyHandlerMethodMapping mapping; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/VersionRequestConditionTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/VersionRequestConditionTests.java index 0c5142f049d..8e89662919a 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/VersionRequestConditionTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/VersionRequestConditionTests.java @@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; * Unit tests for {@link VersionRequestCondition}. * @author Rossen Stoyanchev */ -public class VersionRequestConditionTests { +class VersionRequestConditionTests { private DefaultApiVersionStrategy strategy; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/FragmentRenderingStreamTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/FragmentRenderingStreamTests.java index e2ab21e0491..a5fec8bd397 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/FragmentRenderingStreamTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/FragmentRenderingStreamTests.java @@ -53,7 +53,7 @@ import static org.springframework.web.testfixture.method.ResolvableMethod.on; * @author Rossen Stoyanchev * @author Sebastien Deleuze */ -public class FragmentRenderingStreamTests { +class FragmentRenderingStreamTests { private final MockHttpServletRequest request = new MockHttpServletRequest(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorTests.java index 27e63f1ef8f..97ed03897b2 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorTests.java @@ -66,7 +66,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Rossen Stoyanchev */ @SuppressWarnings("unused") -public class HttpEntityMethodProcessorTests { +class HttpEntityMethodProcessorTests { private MethodParameter paramList; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilderTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilderTests.java index 3467a5f9f03..e7582d619a2 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilderTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilderTests.java @@ -86,7 +86,7 @@ import static org.springframework.web.servlet.mvc.method.annotation.MvcUriCompon * @author Sam Brannen */ @SuppressWarnings("unused") -public class MvcUriComponentsBuilderTests { +class MvcUriComponentsBuilderTests { private final MockHttpServletRequest request = new MockHttpServletRequest(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingVersionHandlerMethodTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingVersionHandlerMethodTests.java index 018c76df79e..1e95b05b25f 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingVersionHandlerMethodTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingVersionHandlerMethodTests.java @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; * Integration tests for API versioning. * @author Rossen Stoyanchev */ -public class RequestMappingVersionHandlerMethodTests { +class RequestMappingVersionHandlerMethodTests { private DispatcherServlet dispatcherServlet; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterTests.java index dab3af9796d..a921c60d96f 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyEmitterTests.java @@ -46,7 +46,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; * @author Brian Clozel */ @ExtendWith(MockitoExtension.class) -public class ResponseBodyEmitterTests { +class ResponseBodyEmitterTests { @Mock private ResponseBodyEmitter.Handler handler; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/CachingResourceResolverTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/CachingResourceResolverTests.java index 7d6926e311d..5a312d6967c 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/CachingResourceResolverTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/CachingResourceResolverTests.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock; * @author Rossen Stoyanchev */ @ExtendWith(GzipSupport.class) -public class CachingResourceResolverTests { +class CachingResourceResolverTests { private Cache cache; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/EncodedResourceResolverTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/EncodedResourceResolverTests.java index 0bb28713ea6..580bdd213c9 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/EncodedResourceResolverTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/EncodedResourceResolverTests.java @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Rossen Stoyanchev */ @ExtendWith(GzipSupport.class) -public class EncodedResourceResolverTests { +class EncodedResourceResolverTests { private ResourceResolverChain resolver; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlProviderJavaConfigTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlProviderJavaConfigTests.java index dd1f94941ea..74962464c86 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlProviderJavaConfigTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlProviderJavaConfigTests.java @@ -52,7 +52,7 @@ class ResourceUrlProviderJavaConfigTests { @BeforeEach - public void setup() throws Exception { + void setup() throws Exception { AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); context.setServletContext(new MockServletContext()); context.register(WebConfig.class); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTagTests.java index 649833423c1..ea739caf9a7 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTagTests.java @@ -56,7 +56,7 @@ public abstract class AbstractHtmlElementTagTests extends AbstractTagTests { @BeforeEach - public final void setUp() throws Exception { + final void setUp() throws Exception { // set up a writer for the tag content to be written to this.writer = new StringWriter(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java index 4472e740e01..019c0b3715b 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/CheckboxesTagTests.java @@ -55,7 +55,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException * @author Jeremy Grelle */ @SuppressWarnings({ "rawtypes", "unchecked" }) -public class CheckboxesTagTests extends AbstractFormTagTests { +class CheckboxesTagTests extends AbstractFormTagTests { private CheckboxesTag tag; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ErrorsTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ErrorsTagTests.java index cf18ce6c840..c5549971449 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ErrorsTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ErrorsTagTests.java @@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Jeremy Grelle */ @SuppressWarnings({ "rawtypes", "unchecked" }) -public class ErrorsTagTests extends AbstractFormTagTests { +class ErrorsTagTests extends AbstractFormTagTests { private static final String COMMAND_NAME = "testBean"; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java index 5b1e5b09167..86e73f0ff2f 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonsTagTests.java @@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException * @author Jeremy Grelle */ @SuppressWarnings({ "rawtypes", "unchecked" }) -public class RadioButtonsTagTests extends AbstractFormTagTests { +class RadioButtonsTagTests extends AbstractFormTagTests { private RadioButtonsTag tag; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SelectTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SelectTagTests.java index 495a3c45c82..0a6a9c00203 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SelectTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SelectTagTests.java @@ -58,7 +58,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; * @author Sam Brannen */ @SuppressWarnings({ "rawtypes", "unchecked" }) -public class SelectTagTests extends AbstractFormTagTests { +class SelectTagTests extends AbstractFormTagTests { private static final Locale LOCALE_AT = new Locale("de", "AT"); private static final Locale LOCALE_NL = new Locale("nl", "NL"); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/DefaultFragmentsRenderingTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/DefaultFragmentsRenderingTests.java index a167a0570bc..4228c7fd745 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/DefaultFragmentsRenderingTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/DefaultFragmentsRenderingTests.java @@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Rossen Stoyanchev * @author Sebastien Deleuze */ -public class DefaultFragmentsRenderingTests { +class DefaultFragmentsRenderingTests { @Test void render() throws Exception { diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerMacroTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerMacroTests.java index d905ac92e29..c890a5ca9ae 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerMacroTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerMacroTests.java @@ -56,7 +56,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @since 25.01.2005 */ @SuppressWarnings("deprecation") -public class FreeMarkerMacroTests { +class FreeMarkerMacroTests { private static final String TEMPLATE_FILE = "test.ftl"; diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/ScriptTemplateViewTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/ScriptTemplateViewTests.java index 0557d38d985..fe2a15ccf8f 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/ScriptTemplateViewTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/ScriptTemplateViewTests.java @@ -56,7 +56,7 @@ import static org.mockito.Mockito.mock; * * @author Sebastien Deleuze */ -public class ScriptTemplateViewTests { +class ScriptTemplateViewTests { private ScriptTemplateView view; @@ -66,7 +66,7 @@ public class ScriptTemplateViewTests { @BeforeEach - public void setup() { + void setup() { this.configurer = new ScriptTemplateConfigurer(); this.wac = new StaticWebApplicationContext(); this.wac.getBeanFactory().registerSingleton("scriptTemplateConfigurer", this.configurer); diff --git a/spring-websocket/src/test/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandlerTests.java b/spring-websocket/src/test/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandlerTests.java index 5b205492d3b..8f681cbde68 100644 --- a/spring-websocket/src/test/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandlerTests.java +++ b/spring-websocket/src/test/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandlerTests.java @@ -49,7 +49,7 @@ import static org.mockito.Mockito.verify; * @author Andy Wilkinson */ @MockitoSettings(strictness = Strictness.LENIENT) -public class SubProtocolWebSocketHandlerTests { +class SubProtocolWebSocketHandlerTests { @Mock SubProtocolHandler stompHandler; diff --git a/spring-websocket/src/test/java/org/springframework/web/socket/server/standard/SpringConfiguratorTests.java b/spring-websocket/src/test/java/org/springframework/web/socket/server/standard/SpringConfiguratorTests.java index c988c405c15..8ee8c045c89 100644 --- a/spring-websocket/src/test/java/org/springframework/web/socket/server/standard/SpringConfiguratorTests.java +++ b/spring-websocket/src/test/java/org/springframework/web/socket/server/standard/SpringConfiguratorTests.java @@ -32,7 +32,7 @@ import org.springframework.web.testfixture.servlet.MockServletContext; import static org.assertj.core.api.Assertions.assertThat; -public class SpringConfiguratorTests { +class SpringConfiguratorTests { private MockServletContext servletContext; diff --git a/src/checkstyle/checkstyle-suppressions.xml b/src/checkstyle/checkstyle-suppressions.xml index 87c389739ae..9dbfa6ad88a 100644 --- a/src/checkstyle/checkstyle-suppressions.xml +++ b/src/checkstyle/checkstyle-suppressions.xml @@ -12,7 +12,6 @@ - @@ -46,7 +45,6 @@ - @@ -56,9 +54,11 @@ + + @@ -103,7 +103,8 @@ - + +