From 32cc32f9a78d637c9daaca6ba329690b13c62cc6 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 12 Aug 2019 11:32:26 +0200 Subject: [PATCH] Migrate test suite from JUnit 4 to JUnit Jupiter This first commit for this issue: - allows JUnit Jupiter to be used for all tests - adds a dependency on mockito-junit-jupiter - migrates tests in spring-core to JUnit Jupiter, except parameterized tests The following script was developed in order to semi-automate the migration process. https://github.com/sbrannen/junit-converters/blob/master/junit4ToJUnitJupiter.zsh See gh-23451 --- build.gradle | 7 +- .../core/AttributeAccessorSupportTests.java | 2 +- .../core/BridgeMethodResolverTests.java | 2 +- .../core/CollectionFactoryTests.java | 2 +- .../springframework/core/ConstantsTests.java | 2 +- .../core/ConventionsTests.java | 2 +- .../core/ExceptionDepthComparatorTests.java | 2 +- .../core/GenericTypeResolverTests.java | 2 +- ...ableTableParameterNameDiscovererTests.java | 2 +- .../core/MethodParameterTests.java | 6 +- .../core/NestedExceptionTests.java | 2 +- .../core/OrderComparatorTests.java | 2 +- .../core/ParameterizedTypeReferenceTests.java | 2 +- ...ioritizedParameterNameDiscovererTests.java | 2 +- .../core/ReactiveAdapterRegistryTests.java | 2 +- .../core/ResolvableTypeTests.java | 8 +- .../core/SerializableTypeWrapperTests.java | 2 +- .../core/SimpleAliasRegistryTests.java | 2 +- .../core/SortedPropertiesTests.java | 2 +- ...dReflectionParameterNameDiscoverTests.java | 6 +- .../AnnotatedElementUtilsTests.java | 6 +- .../annotation/AnnotationAttributesTests.java | 2 +- .../AnnotationAwareOrderComparatorTests.java | 2 +- .../AnnotationBackCompatibiltyTests.java | 2 +- .../annotation/AnnotationFilterTests.java | 2 +- .../AnnotationIntrospectionFailureTests.java | 2 +- .../AnnotationTypeMappingsTests.java | 2 +- .../core/annotation/AnnotationUtilsTests.java | 6 +- .../annotation/AnnotationsScannerTests.java | 2 +- .../annotation/AttributeMethodsTests.java | 2 +- .../ComposedRepeatableAnnotationsTests.java | 2 +- .../MergedAnnotationClassLoaderTests.java | 2 +- .../MergedAnnotationCollectorsTests.java | 2 +- .../MergedAnnotationPredicatesTests.java | 2 +- .../MergedAnnotationsCollectionTests.java | 2 +- ...ComposedOnSingleAnnotatedElementTests.java | 2 +- ...dAnnotationsRepeatableAnnotationTests.java | 2 +- .../annotation/MergedAnnotationsTests.java | 2 +- .../MissingMergedAnnotationTests.java | 2 +- ...otationsOnSingleAnnotatedElementTests.java | 6 +- .../annotation/OrderSourceProviderTests.java | 2 +- .../core/annotation/OrderUtilsTests.java | 2 +- .../PackagesAnnotationFilterTests.java | 2 +- .../annotation/RepeatableContainersTests.java | 2 +- .../SynthesizingMethodParameterTests.java | 6 +- .../annotation/TypeMappedAnnotationTests.java | 2 +- .../core/codec/AbstractDecoderTestCase.java | 2 +- .../core/codec/AbstractEncoderTestCase.java | 2 +- .../core/codec/ByteArrayDecoderTests.java | 2 +- .../core/codec/ByteArrayEncoderTests.java | 2 +- .../core/codec/ByteBufferDecoderTests.java | 2 +- .../core/codec/ByteBufferEncoderTests.java | 2 +- .../core/codec/CharSequenceEncoderTests.java | 2 +- .../core/codec/DataBufferDecoderTests.java | 2 +- .../core/codec/DataBufferEncoderTests.java | 2 +- .../core/codec/ResourceDecoderTests.java | 2 +- .../core/codec/ResourceEncoderTests.java | 2 +- .../codec/ResourceRegionEncoderTests.java | 6 +- .../core/codec/StringDecoderTests.java | 2 +- .../core/convert/TypeDescriptorTests.java | 2 +- .../converter/ConvertingComparatorTests.java | 2 +- .../DefaultConversionServiceTests.java | 2 +- .../support/ByteBufferConverterTests.java | 6 +- .../CollectionToCollectionConverterTests.java | 6 +- .../GenericConversionServiceTests.java | 2 +- .../support/MapToMapConverterTests.java | 6 +- .../convert/support/StreamConverterTests.java | 6 +- .../env/CompositePropertySourceTests.java | 2 +- .../core/env/CustomEnvironmentTests.java | 2 +- .../JOptCommandLinePropertySourceTests.java | 2 +- .../core/env/MutablePropertySourcesTests.java | 2 +- .../core/env/ProfilesTests.java | 2 +- .../core/env/PropertySourceTests.java | 2 +- .../PropertySourcesPropertyResolverTests.java | 6 +- .../env/SimpleCommandLineParserTests.java | 2 +- .../SimpleCommandLinePropertySourceTests.java | 2 +- .../core/env/StandardEnvironmentTests.java | 2 +- .../SystemEnvironmentPropertySourceTests.java | 6 +- .../core/io/ClassPathResourceTests.java | 2 +- .../core/io/PathResourceTests.java | 24 ++-- .../core/io/ResourceEditorTests.java | 2 +- .../core/io/ResourceTests.java | 2 +- .../buffer/AbstractLeakCheckingTestCase.java | 4 +- .../io/buffer/LeakAwareDataBufferFactory.java | 12 +- .../LeakAwareDataBufferFactoryTests.java | 2 +- .../core/io/support/EncodedResourceTests.java | 2 +- ...hMatchingResourcePatternResolverTests.java | 6 +- .../ResourceArrayPropertyEditorTests.java | 2 +- .../support/ResourcePropertySourceTests.java | 2 +- .../core/io/support/ResourceRegionTests.java | 2 +- .../support/SpringFactoriesLoaderTests.java | 2 +- .../core/log/LogSupportTests.java | 2 +- .../SerializationConverterTests.java | 2 +- .../core/style/DefaultValueStylerTests.java | 2 +- .../core/style/ToStringCreatorTests.java | 6 +- .../task/SimpleAsyncTaskExecutorTests.java | 2 +- .../type/AbstractAnnotationMetadataTests.java | 2 +- ...AbstractClassMetadataMemberClassTests.java | 2 +- .../type/AbstractMethodMetadataTests.java | 2 +- .../core/type/AnnotationMetadataTests.java | 2 +- .../core/type/AnnotationTypeFilterTests.java | 60 ++-------- .../type/AnnotationTypeFilterTestsTypes.java | 64 ++++++++++ .../core/type/AspectJTypeFilterTests.java | 112 +++++++----------- .../type/AspectJTypeFilterTestsTypes.java | 51 ++++++++ .../core/type/AssignableTypeFilterTests.java | 47 ++------ .../type/AssignableTypeFilterTestsTypes.java | 51 ++++++++ .../type/CachingMetadataReaderLeakTests.java | 2 +- .../MergedAnnotationMetadataVisitorTests.java | 2 +- .../springframework/tests/AssumeTests.java | 10 +- .../springframework/tests/TestGroupTests.java | 2 +- .../util/AntPathMatcherTests.java | 2 +- .../org/springframework/util/AssertTests.java | 2 +- .../util/AutoPopulatingListTests.java | 2 +- .../util/Base64UtilsTests.java | 2 +- .../springframework/util/ClassUtilsTests.java | 6 +- .../util/CollectionUtilsTests.java | 2 +- .../util/CompositeIteratorTests.java | 2 +- .../util/ConcurrentReferenceHashMapTests.java | 6 +- .../util/DigestUtilsTests.java | 6 +- .../util/ExceptionTypeFilterTests.java | 2 +- .../util/ExponentialBackOffTests.java | 2 +- .../util/FastByteArrayOutputStreamTests.java | 2 +- .../util/FileCopyUtilsTests.java | 2 +- .../util/FileSystemUtilsTests.java | 6 +- .../util/FixedBackOffTests.java | 2 +- .../util/InstanceFilterTests.java | 2 +- .../util/LinkedCaseInsensitiveMapTests.java | 2 +- .../util/LinkedMultiValueMapTests.java | 2 +- .../util/MethodInvokerTests.java | 2 +- .../springframework/util/MimeTypeTests.java | 2 +- .../util/NumberUtilsTests.java | 2 +- .../util/ObjectUtilsTests.java | 2 +- .../util/PatternMatchUtilsTests.java | 2 +- .../util/PropertiesPersisterTests.java | 2 +- .../util/PropertyPlaceholderHelperTests.java | 2 +- .../util/ReflectionUtilsTests.java | 6 +- .../ResizableByteArrayOutputStreamTests.java | 6 +- .../util/ResourceUtilsTests.java | 2 +- .../util/SerializationUtilsTests.java | 2 +- .../util/SocketUtilsTests.java | 2 +- .../springframework/util/StopWatchTests.java | 2 +- .../util/StreamUtilsTests.java | 6 +- .../util/StringUtilsTests.java | 2 +- .../util/SystemPropertyUtilsTests.java | 2 +- .../springframework/util/TypeUtilsTests.java | 2 +- .../comparator/BooleanComparatorTests.java | 2 +- .../comparator/ComparableComparatorTests.java | 2 +- .../comparator/CompoundComparatorTests.java | 2 +- .../comparator/InstanceComparatorTests.java | 2 +- .../comparator/InvertibleComparatorTests.java | 2 +- .../comparator/NullSafeComparatorTests.java | 2 +- .../util/concurrent/FutureAdapterTests.java | 6 +- .../concurrent/ListenableFutureTaskTests.java | 2 +- .../MonoToListenableFutureAdapterTests.java | 2 +- .../SettableListenableFutureTests.java | 2 +- .../util/unit/DataSizeTests.java | 2 +- .../util/xml/AbstractStaxHandlerTestCase.java | 6 +- .../xml/AbstractStaxXMLReaderTestCase.java | 6 +- .../util/xml/DomContentHandlerTests.java | 6 +- .../xml/ListBasedXMLEventReaderTests.java | 2 +- .../util/xml/SimpleNamespaceContextTests.java | 2 +- .../util/xml/StaxEventXMLReaderTests.java | 2 +- .../util/xml/StaxResultTests.java | 6 +- .../util/xml/StaxSourceTests.java | 6 +- .../util/xml/StaxStreamXMLReaderTests.java | 2 +- .../util/xml/StaxUtilsTests.java | 2 +- .../util/xml/TransformerUtilsTests.java | 2 +- .../util/xml/XMLEventStreamReaderTests.java | 6 +- .../util/xml/XMLEventStreamWriterTests.java | 6 +- ...tlinDefaultParameterNameDiscovererTests.kt | 4 +- .../core/KotlinGenericTypeResolverTests.kt | 2 +- .../core/KotlinMethodParameterTests.kt | 5 +- .../KotlinReactiveAdapterRegistryTests.kt | 2 +- ...nReflectionParameterNameDiscovererTests.kt | 5 +- .../env/PropertyResolverExtensionsTests.kt | 2 +- 175 files changed, 494 insertions(+), 410 deletions(-) create mode 100644 spring-core/src/test/java/org/springframework/core/type/AnnotationTypeFilterTestsTypes.java create mode 100644 spring-core/src/test/java/org/springframework/core/type/AspectJTypeFilterTestsTypes.java create mode 100644 spring-core/src/test/java/org/springframework/core/type/AssignableTypeFilterTestsTypes.java diff --git a/build.gradle b/build.gradle index 3e178257d0a..0d21caa6766 100644 --- a/build.gradle +++ b/build.gradle @@ -136,18 +136,21 @@ configure(allprojects) { project -> } dependencies { + testCompile("org.junit.jupiter:junit-jupiter-api") + testCompile("org.junit.jupiter:junit-jupiter-params") testCompile("junit:junit:4.13-beta-3") { exclude group: "org.hamcrest", module: "hamcrest-core" } testCompile("org.mockito:mockito-core:3.0.0") { exclude group: "org.hamcrest", module: "hamcrest-core" } + testCompile("org.mockito:mockito-junit-jupiter:3.0.0") testCompile("io.mockk:mockk:1.9.3") testCompile("org.hamcrest:hamcrest-all:1.3") testCompile("org.assertj:assertj-core:3.13.1") - // Pull in the latest JUnit 5 Launcher API and the Vintage engine as well - // so that we can run JUnit 4 tests in IDEs. + // Pull in the latest JUnit 5 Launcher API to ensure proper support in IDEs. testRuntime("org.junit.platform:junit-platform-launcher") + testRuntime("org.junit.jupiter:junit-jupiter-engine") testRuntime("org.junit.vintage:junit-vintage-engine") testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}") testRuntime("org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}") diff --git a/spring-core/src/test/java/org/springframework/core/AttributeAccessorSupportTests.java b/spring-core/src/test/java/org/springframework/core/AttributeAccessorSupportTests.java index 05e6f619d9f..23afd8918eb 100644 --- a/spring-core/src/test/java/org/springframework/core/AttributeAccessorSupportTests.java +++ b/spring-core/src/test/java/org/springframework/core/AttributeAccessorSupportTests.java @@ -18,7 +18,7 @@ package org.springframework.core; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java b/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java index 59e0c59aa4c..8486927b457 100644 --- a/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java +++ b/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.concurrent.DelayQueue; import java.util.concurrent.Delayed; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.util.ReflectionUtils; diff --git a/spring-core/src/test/java/org/springframework/core/CollectionFactoryTests.java b/spring-core/src/test/java/org/springframework/core/CollectionFactoryTests.java index 737beb72637..151b61f4ede 100644 --- a/spring-core/src/test/java/org/springframework/core/CollectionFactoryTests.java +++ b/spring-core/src/test/java/org/springframework/core/CollectionFactoryTests.java @@ -35,7 +35,7 @@ import java.util.TreeMap; import java.util.TreeSet; import org.assertj.core.api.Assertions; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; diff --git a/spring-core/src/test/java/org/springframework/core/ConstantsTests.java b/spring-core/src/test/java/org/springframework/core/ConstantsTests.java index e2d9a832ee9..235cb12c422 100644 --- a/spring-core/src/test/java/org/springframework/core/ConstantsTests.java +++ b/spring-core/src/test/java/org/springframework/core/ConstantsTests.java @@ -19,7 +19,7 @@ package org.springframework.core; import java.util.Locale; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/core/ConventionsTests.java b/spring-core/src/test/java/org/springframework/core/ConventionsTests.java index db159aa0964..890b0e6e05c 100644 --- a/spring-core/src/test/java/org/springframework/core/ConventionsTests.java +++ b/spring-core/src/test/java/org/springframework/core/ConventionsTests.java @@ -25,7 +25,7 @@ import java.util.Set; import io.reactivex.Observable; import io.reactivex.Single; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; diff --git a/spring-core/src/test/java/org/springframework/core/ExceptionDepthComparatorTests.java b/spring-core/src/test/java/org/springframework/core/ExceptionDepthComparatorTests.java index 601aba89639..e7a87b9ab4d 100644 --- a/spring-core/src/test/java/org/springframework/core/ExceptionDepthComparatorTests.java +++ b/spring-core/src/test/java/org/springframework/core/ExceptionDepthComparatorTests.java @@ -18,7 +18,7 @@ package org.springframework.core; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java b/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java index d8bc57cbfa0..209071a316a 100644 --- a/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java +++ b/spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java @@ -25,7 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.core.GenericTypeResolver.getTypeVariableMap; diff --git a/spring-core/src/test/java/org/springframework/core/LocalVariableTableParameterNameDiscovererTests.java b/spring-core/src/test/java/org/springframework/core/LocalVariableTableParameterNameDiscovererTests.java index bba252a8bd4..4d92c296eab 100644 --- a/spring-core/src/test/java/org/springframework/core/LocalVariableTableParameterNameDiscovererTests.java +++ b/spring-core/src/test/java/org/springframework/core/LocalVariableTableParameterNameDiscovererTests.java @@ -23,7 +23,7 @@ import java.lang.reflect.Method; import java.util.Date; import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.tests.sample.objects.TestObject; diff --git a/spring-core/src/test/java/org/springframework/core/MethodParameterTests.java b/spring-core/src/test/java/org/springframework/core/MethodParameterTests.java index 12beb094faa..8b10e3604b9 100644 --- a/spring-core/src/test/java/org/springframework/core/MethodParameterTests.java +++ b/spring-core/src/test/java/org/springframework/core/MethodParameterTests.java @@ -25,8 +25,8 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.concurrent.Callable; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; @@ -50,7 +50,7 @@ public class MethodParameterTests { private MethodParameter intReturnType; - @Before + @BeforeEach public void setup() throws NoSuchMethodException { method = getClass().getMethod("method", String.class, Long.TYPE); stringParameter = new MethodParameter(method, 0); diff --git a/spring-core/src/test/java/org/springframework/core/NestedExceptionTests.java b/spring-core/src/test/java/org/springframework/core/NestedExceptionTests.java index 947dfbc8586..8e4d44bfb15 100644 --- a/spring-core/src/test/java/org/springframework/core/NestedExceptionTests.java +++ b/spring-core/src/test/java/org/springframework/core/NestedExceptionTests.java @@ -19,7 +19,7 @@ package org.springframework.core; import java.io.ByteArrayOutputStream; import java.io.PrintWriter; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/OrderComparatorTests.java b/spring-core/src/test/java/org/springframework/core/OrderComparatorTests.java index f911e944632..c27ff5c44ed 100644 --- a/spring-core/src/test/java/org/springframework/core/OrderComparatorTests.java +++ b/spring-core/src/test/java/org/springframework/core/OrderComparatorTests.java @@ -18,7 +18,7 @@ package org.springframework.core; import java.util.Comparator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/ParameterizedTypeReferenceTests.java b/spring-core/src/test/java/org/springframework/core/ParameterizedTypeReferenceTests.java index b05368f8f27..82590101428 100644 --- a/spring-core/src/test/java/org/springframework/core/ParameterizedTypeReferenceTests.java +++ b/spring-core/src/test/java/org/springframework/core/ParameterizedTypeReferenceTests.java @@ -20,7 +20,7 @@ import java.lang.reflect.Type; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/PrioritizedParameterNameDiscovererTests.java b/spring-core/src/test/java/org/springframework/core/PrioritizedParameterNameDiscovererTests.java index 47db5a3ac08..edd68764bef 100644 --- a/spring-core/src/test/java/org/springframework/core/PrioritizedParameterNameDiscovererTests.java +++ b/spring-core/src/test/java/org/springframework/core/PrioritizedParameterNameDiscovererTests.java @@ -20,7 +20,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.tests.sample.objects.TestObject; diff --git a/spring-core/src/test/java/org/springframework/core/ReactiveAdapterRegistryTests.java b/spring-core/src/test/java/org/springframework/core/ReactiveAdapterRegistryTests.java index fbf3513eebd..ccb1475eb15 100644 --- a/spring-core/src/test/java/org/springframework/core/ReactiveAdapterRegistryTests.java +++ b/spring-core/src/test/java/org/springframework/core/ReactiveAdapterRegistryTests.java @@ -24,7 +24,7 @@ import java.util.concurrent.CompletableFuture; import io.reactivex.Flowable; import io.reactivex.Maybe; import kotlinx.coroutines.Deferred; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; import reactor.core.publisher.FluxProcessor; diff --git a/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java b/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java index b4d81398a6a..5395c54455c 100644 --- a/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java +++ b/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java @@ -43,11 +43,11 @@ import java.util.TreeSet; import java.util.concurrent.Callable; import org.assertj.core.api.AbstractAssert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.core.ResolvableType.VariableResolver; import org.springframework.util.MultiValueMap; @@ -68,7 +68,7 @@ import static org.mockito.Mockito.verify; * @author Sebastien Deleuze */ @SuppressWarnings("rawtypes") -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class ResolvableTypeTests { @Captor diff --git a/spring-core/src/test/java/org/springframework/core/SerializableTypeWrapperTests.java b/spring-core/src/test/java/org/springframework/core/SerializableTypeWrapperTests.java index fe8ac43dc77..8e0418c659c 100644 --- a/spring-core/src/test/java/org/springframework/core/SerializableTypeWrapperTests.java +++ b/spring-core/src/test/java/org/springframework/core/SerializableTypeWrapperTests.java @@ -29,7 +29,7 @@ import java.lang.reflect.TypeVariable; import java.lang.reflect.WildcardType; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/SimpleAliasRegistryTests.java b/spring-core/src/test/java/org/springframework/core/SimpleAliasRegistryTests.java index 4011032420d..f3ac0304707 100644 --- a/spring-core/src/test/java/org/springframework/core/SimpleAliasRegistryTests.java +++ b/spring-core/src/test/java/org/springframework/core/SimpleAliasRegistryTests.java @@ -16,7 +16,7 @@ package org.springframework.core; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/SortedPropertiesTests.java b/spring-core/src/test/java/org/springframework/core/SortedPropertiesTests.java index 5b2f13c17c4..72825f9c30b 100644 --- a/spring-core/src/test/java/org/springframework/core/SortedPropertiesTests.java +++ b/spring-core/src/test/java/org/springframework/core/SortedPropertiesTests.java @@ -23,7 +23,7 @@ import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.Properties; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static java.util.Arrays.stream; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/StandardReflectionParameterNameDiscoverTests.java b/spring-core/src/test/java/org/springframework/core/StandardReflectionParameterNameDiscoverTests.java index 2f20f4cd797..0bd71711a25 100644 --- a/spring-core/src/test/java/org/springframework/core/StandardReflectionParameterNameDiscoverTests.java +++ b/spring-core/src/test/java/org/springframework/core/StandardReflectionParameterNameDiscoverTests.java @@ -17,8 +17,8 @@ package org.springframework.core; import java.lang.reflect.Method; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.util.ReflectionUtils; @@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class StandardReflectionParameterNameDiscoverTests { private ParameterNameDiscoverer parameterNameDiscoverer; - @Before + @BeforeEach public void setup() { parameterNameDiscoverer = new StandardReflectionParameterNameDiscoverer(); } diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java index 17a4559f4b1..89954c2b154 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotatedElementUtilsTests.java @@ -34,8 +34,8 @@ import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.Resource; import javax.annotation.meta.When; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.springframework.core.annotation.AnnotationUtilsTests.ExtendsBaseClassWithGenericAnnotatedMethod; import org.springframework.core.annotation.AnnotationUtilsTests.ImplementsInterfaceWithGenericAnnotatedMethod; @@ -384,7 +384,7 @@ public class AnnotatedElementUtilsTests { * the first test class or the second one (with different exceptions), depending * on the order in which the JVM returns the attribute methods via reflection. */ - @Ignore("Permanently disabled but left in place for illustrative purposes") + @Disabled("Permanently disabled but left in place for illustrative purposes") @Test public void getMergedAnnotationAttributesWithHalfConventionBasedAndHalfAliasedComposedAnnotation() { for (Class clazz : asList(HalfConventionBasedAndHalfAliasedComposedContextConfigClassV1.class, diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationAttributesTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationAttributesTests.java index a41e43c9e5f..ff85b7b2367 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationAttributesTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationAttributesTests.java @@ -21,7 +21,7 @@ import java.lang.annotation.RetentionPolicy; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.annotation.AnnotationUtilsTests.ImplicitAliasesContextConfig; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationAwareOrderComparatorTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationAwareOrderComparatorTests.java index ea674b82a3f..689eeee3bba 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationAwareOrderComparatorTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationAwareOrderComparatorTests.java @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.List; import javax.annotation.Priority; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibiltyTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibiltyTests.java index c2738a3d1f7..d8a927e72be 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibiltyTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibiltyTests.java @@ -19,7 +19,7 @@ package org.springframework.core.annotation; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationFilterTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationFilterTests.java index 651e8263334..d7b8b3ba524 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationFilterTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationFilterTests.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import javax.annotation.Nonnull; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.lang.Nullable; import org.springframework.util.ObjectUtils; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationIntrospectionFailureTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationIntrospectionFailureTests.java index 7fb7de3154d..c56b3719bec 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationIntrospectionFailureTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationIntrospectionFailureTests.java @@ -21,7 +21,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.reflect.Method; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.OverridingClassLoader; import org.springframework.util.ClassUtils; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationTypeMappingsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationTypeMappingsTests.java index e0d4a2326ef..74b7b7ffc48 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationTypeMappingsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationTypeMappingsTests.java @@ -30,7 +30,7 @@ import java.util.List; import java.util.Map; import javax.annotation.Nullable; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.annotation.AnnotationTypeMapping.MirrorSets; import org.springframework.core.annotation.AnnotationTypeMapping.MirrorSets.MirrorSet; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java index f7f54ad651c..3377db1a60b 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java @@ -32,8 +32,8 @@ import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.Ordered; import org.springframework.core.annotation.subpackage.NonPublicAnnotatedClass; @@ -74,7 +74,7 @@ import static org.springframework.core.annotation.AnnotationUtils.synthesizeAnno @SuppressWarnings("deprecation") public class AnnotationUtilsTests { - @Before + @BeforeEach public void clearCacheBeforeTests() { AnnotationUtils.clearCache(); } diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java index 96df294216f..9e1704181ba 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java @@ -28,7 +28,7 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.annotation.MergedAnnotations.SearchStrategy; import org.springframework.lang.Nullable; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AttributeMethodsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AttributeMethodsTests.java index f4de24915b0..c3728d27f73 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AttributeMethodsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AttributeMethodsTests.java @@ -24,7 +24,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/ComposedRepeatableAnnotationsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/ComposedRepeatableAnnotationsTests.java index b23952a7f2d..95eddb1fb63 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/ComposedRepeatableAnnotationsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/ComposedRepeatableAnnotationsTests.java @@ -27,7 +27,7 @@ import java.util.Iterator; import java.util.Set; import org.assertj.core.api.ThrowableAssert.ThrowingCallable; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationClassLoaderTests.java b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationClassLoaderTests.java index 72778fd7ce6..73782bc9465 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationClassLoaderTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationClassLoaderTests.java @@ -21,7 +21,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.reflect.Method; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.OverridingClassLoader; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationCollectorsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationCollectorsTests.java index fa9c9b1eca5..46d6e45dc55 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationCollectorsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationCollectorsTests.java @@ -25,7 +25,7 @@ import java.util.LinkedHashSet; import java.util.Set; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.annotation.MergedAnnotation.Adapt; import org.springframework.util.MultiValueMap; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationPredicatesTests.java b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationPredicatesTests.java index 20a78597813..a194c2061b5 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationPredicatesTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationPredicatesTests.java @@ -24,7 +24,7 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsCollectionTests.java b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsCollectionTests.java index 635664c5f02..e25428bd254 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsCollectionTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsCollectionTests.java @@ -24,7 +24,7 @@ import java.util.Collections; import java.util.List; import java.util.Spliterator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsComposedOnSingleAnnotatedElementTests.java b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsComposedOnSingleAnnotatedElementTests.java index 28d375f3175..2e90e779570 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsComposedOnSingleAnnotatedElementTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsComposedOnSingleAnnotatedElementTests.java @@ -27,7 +27,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.annotation.MergedAnnotations.SearchStrategy; import org.springframework.util.ReflectionUtils; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsRepeatableAnnotationTests.java b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsRepeatableAnnotationTests.java index 1970206a9eb..3faa4c41b26 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsRepeatableAnnotationTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsRepeatableAnnotationTests.java @@ -27,7 +27,7 @@ import java.lang.reflect.AnnotatedElement; import java.util.Set; import org.assertj.core.api.ThrowableTypeAssert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.annotation.MergedAnnotations.SearchStrategy; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java index 8069aed36f3..fc5900f7dca 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java @@ -36,7 +36,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Resource; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.Ordered; import org.springframework.core.annotation.MergedAnnotation.Adapt; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/MissingMergedAnnotationTests.java b/spring-core/src/test/java/org/springframework/core/annotation/MissingMergedAnnotationTests.java index 48b3a68570c..9c33388d23b 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/MissingMergedAnnotationTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/MissingMergedAnnotationTests.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.NoSuchElementException; import org.assertj.core.api.ThrowableTypeAssert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.util.ConcurrentReferenceHashMap; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/MultipleComposedAnnotationsOnSingleAnnotatedElementTests.java b/spring-core/src/test/java/org/springframework/core/annotation/MultipleComposedAnnotationsOnSingleAnnotatedElementTests.java index 42e229845d2..cf48e3d107e 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/MultipleComposedAnnotationsOnSingleAnnotatedElementTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/MultipleComposedAnnotationsOnSingleAnnotatedElementTests.java @@ -26,8 +26,8 @@ import java.lang.reflect.Method; import java.util.Iterator; import java.util.Set; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.core.annotation.AnnotatedElementUtils.findAllMergedAnnotations; @@ -105,7 +105,7 @@ public class MultipleComposedAnnotationsOnSingleAnnotatedElementTests { } @Test - @Ignore("Disabled since some Java 8 updates handle the bridge method differently") + @Disabled("Disabled since some Java 8 updates handle the bridge method differently") public void getMultipleComposedAnnotationsOnBridgeMethod() throws Exception { Set cacheables = getAllMergedAnnotations(getBridgeMethod(), Cacheable.class); assertThat(cacheables).isNotNull(); diff --git a/spring-core/src/test/java/org/springframework/core/annotation/OrderSourceProviderTests.java b/spring-core/src/test/java/org/springframework/core/annotation/OrderSourceProviderTests.java index 2c1816d861b..8b983cd63c7 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/OrderSourceProviderTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/OrderSourceProviderTests.java @@ -21,7 +21,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.Ordered; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/OrderUtilsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/OrderUtilsTests.java index ae15e2de5c5..dbb1577e44a 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/OrderUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/OrderUtilsTests.java @@ -18,7 +18,7 @@ package org.springframework.core.annotation; import javax.annotation.Priority; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/PackagesAnnotationFilterTests.java b/spring-core/src/test/java/org/springframework/core/annotation/PackagesAnnotationFilterTests.java index 43666aec9f7..d8a8b2c4c7f 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/PackagesAnnotationFilterTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/PackagesAnnotationFilterTests.java @@ -16,7 +16,7 @@ package org.springframework.core.annotation; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/RepeatableContainersTests.java b/spring-core/src/test/java/org/springframework/core/annotation/RepeatableContainersTests.java index 2195f0eb512..d710d02e732 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/RepeatableContainersTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/RepeatableContainersTests.java @@ -21,7 +21,7 @@ import java.lang.annotation.Repeatable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/core/annotation/SynthesizingMethodParameterTests.java b/spring-core/src/test/java/org/springframework/core/annotation/SynthesizingMethodParameterTests.java index 3d63bdbc9fa..e822b1ced7e 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/SynthesizingMethodParameterTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/SynthesizingMethodParameterTests.java @@ -18,8 +18,8 @@ package org.springframework.core.annotation; import java.lang.reflect.Method; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.MethodParameter; @@ -41,7 +41,7 @@ public class SynthesizingMethodParameterTests { private SynthesizingMethodParameter intReturnType; - @Before + @BeforeEach public void setUp() throws NoSuchMethodException { method = getClass().getMethod("method", String.class, Long.TYPE); stringParameter = new SynthesizingMethodParameter(method, 0); diff --git a/spring-core/src/test/java/org/springframework/core/annotation/TypeMappedAnnotationTests.java b/spring-core/src/test/java/org/springframework/core/annotation/TypeMappedAnnotationTests.java index af29943b99c..6b13b945cc0 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/TypeMappedAnnotationTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/TypeMappedAnnotationTests.java @@ -24,7 +24,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/codec/AbstractDecoderTestCase.java b/spring-core/src/test/java/org/springframework/core/codec/AbstractDecoderTestCase.java index 99e07518295..eb1c5bd8d72 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/AbstractDecoderTestCase.java +++ b/spring-core/src/test/java/org/springframework/core/codec/AbstractDecoderTestCase.java @@ -20,7 +20,7 @@ import java.time.Duration; import java.util.Map; import java.util.function.Consumer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; diff --git a/spring-core/src/test/java/org/springframework/core/codec/AbstractEncoderTestCase.java b/spring-core/src/test/java/org/springframework/core/codec/AbstractEncoderTestCase.java index 34d9795d33a..653c0b033f6 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/AbstractEncoderTestCase.java +++ b/spring-core/src/test/java/org/springframework/core/codec/AbstractEncoderTestCase.java @@ -19,7 +19,7 @@ package org.springframework.core.codec; import java.util.Map; import java.util.function.Consumer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; import reactor.test.StepVerifier; diff --git a/spring-core/src/test/java/org/springframework/core/codec/ByteArrayDecoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/ByteArrayDecoderTests.java index e14cf54965e..aab062bb66f 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/ByteArrayDecoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/ByteArrayDecoderTests.java @@ -19,7 +19,7 @@ package org.springframework.core.codec; import java.nio.charset.StandardCharsets; import java.util.function.Consumer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import org.springframework.core.ResolvableType; diff --git a/spring-core/src/test/java/org/springframework/core/codec/ByteArrayEncoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/ByteArrayEncoderTests.java index 4b40a62f3bb..9d20c93134f 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/ByteArrayEncoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/ByteArrayEncoderTests.java @@ -18,7 +18,7 @@ package org.springframework.core.codec; import java.nio.charset.StandardCharsets; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import org.springframework.core.ResolvableType; diff --git a/spring-core/src/test/java/org/springframework/core/codec/ByteBufferDecoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/ByteBufferDecoderTests.java index b8d02a313eb..5b003c397ba 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/ByteBufferDecoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/ByteBufferDecoderTests.java @@ -20,7 +20,7 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.function.Consumer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import org.springframework.core.ResolvableType; diff --git a/spring-core/src/test/java/org/springframework/core/codec/ByteBufferEncoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/ByteBufferEncoderTests.java index cd343a217f0..e6275a44842 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/ByteBufferEncoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/ByteBufferEncoderTests.java @@ -19,7 +19,7 @@ package org.springframework.core.codec; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import org.springframework.core.ResolvableType; diff --git a/spring-core/src/test/java/org/springframework/core/codec/CharSequenceEncoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/CharSequenceEncoderTests.java index fdb717f8456..14b29df3283 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/CharSequenceEncoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/CharSequenceEncoderTests.java @@ -19,7 +19,7 @@ package org.springframework.core.codec; import java.nio.charset.Charset; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import org.springframework.core.ResolvableType; diff --git a/spring-core/src/test/java/org/springframework/core/codec/DataBufferDecoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/DataBufferDecoderTests.java index ebe6988b947..5829d953ce3 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/DataBufferDecoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/DataBufferDecoderTests.java @@ -19,7 +19,7 @@ package org.springframework.core.codec; import java.nio.charset.StandardCharsets; import java.util.function.Consumer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import org.springframework.core.ResolvableType; diff --git a/spring-core/src/test/java/org/springframework/core/codec/DataBufferEncoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/DataBufferEncoderTests.java index 9238478fa10..29ccfb4469c 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/DataBufferEncoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/DataBufferEncoderTests.java @@ -18,7 +18,7 @@ package org.springframework.core.codec; import java.nio.charset.StandardCharsets; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; diff --git a/spring-core/src/test/java/org/springframework/core/codec/ResourceDecoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/ResourceDecoderTests.java index 2fb64848dda..2191057da3c 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/ResourceDecoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/ResourceDecoderTests.java @@ -20,7 +20,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import org.springframework.core.ResolvableType; diff --git a/spring-core/src/test/java/org/springframework/core/codec/ResourceEncoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/ResourceEncoderTests.java index fd532e2ee71..387ba67acab 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/ResourceEncoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/ResourceEncoderTests.java @@ -18,7 +18,7 @@ package org.springframework.core.codec; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; import reactor.test.StepVerifier; diff --git a/spring-core/src/test/java/org/springframework/core/codec/ResourceRegionEncoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/ResourceRegionEncoderTests.java index bbd015810c6..7891f158cce 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/ResourceRegionEncoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/ResourceRegionEncoderTests.java @@ -19,8 +19,8 @@ package org.springframework.core.codec; import java.util.Collections; import java.util.function.Consumer; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.reactivestreams.Subscription; import reactor.core.publisher.BaseSubscriber; import reactor.core.publisher.Flux; @@ -52,7 +52,7 @@ public class ResourceRegionEncoderTests { private LeakAwareDataBufferFactory bufferFactory = new LeakAwareDataBufferFactory(); - @After + @AfterEach public void tearDown() throws Exception { this.bufferFactory.checkForLeaks(); } diff --git a/spring-core/src/test/java/org/springframework/core/codec/StringDecoderTests.java b/spring-core/src/test/java/org/springframework/core/codec/StringDecoderTests.java index 26833c483a5..5ead7d8ef88 100644 --- a/spring-core/src/test/java/org/springframework/core/codec/StringDecoderTests.java +++ b/spring-core/src/test/java/org/springframework/core/codec/StringDecoderTests.java @@ -23,7 +23,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import reactor.test.StepVerifier; diff --git a/spring-core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java b/spring-core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java index 9ffbcf33cee..428d40dd992 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/TypeDescriptorTests.java @@ -36,7 +36,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.MethodParameter; import org.springframework.util.LinkedMultiValueMap; diff --git a/spring-core/src/test/java/org/springframework/core/convert/converter/ConvertingComparatorTests.java b/spring-core/src/test/java/org/springframework/core/convert/converter/ConvertingComparatorTests.java index 711b2f7bfb6..8ed29d17522 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/converter/ConvertingComparatorTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/converter/ConvertingComparatorTests.java @@ -23,7 +23,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Map.Entry; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.support.DefaultConversionService; diff --git a/spring-core/src/test/java/org/springframework/core/convert/converter/DefaultConversionServiceTests.java b/spring-core/src/test/java/org/springframework/core/convert/converter/DefaultConversionServiceTests.java index b05c194f489..d003c318c54 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/converter/DefaultConversionServiceTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/converter/DefaultConversionServiceTests.java @@ -44,7 +44,7 @@ import java.util.TimeZone; import java.util.UUID; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.MethodParameter; import org.springframework.core.convert.ConversionFailedException; diff --git a/spring-core/src/test/java/org/springframework/core/convert/support/ByteBufferConverterTests.java b/spring-core/src/test/java/org/springframework/core/convert/support/ByteBufferConverterTests.java index 4f29bfd38e9..71825d2d448 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/support/ByteBufferConverterTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/support/ByteBufferConverterTests.java @@ -18,8 +18,8 @@ package org.springframework.core.convert.support; import java.nio.ByteBuffer; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.convert.converter.Converter; @@ -40,7 +40,7 @@ public class ByteBufferConverterTests { private GenericConversionService conversionService; - @Before + @BeforeEach public void setup() { this.conversionService = new DefaultConversionService(); this.conversionService.addConverter(new ByteArrayToOtherTypeConverter()); diff --git a/spring-core/src/test/java/org/springframework/core/convert/support/CollectionToCollectionConverterTests.java b/spring-core/src/test/java/org/springframework/core/convert/support/CollectionToCollectionConverterTests.java index ca018890494..c9cd470c328 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/support/CollectionToCollectionConverterTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/support/CollectionToCollectionConverterTests.java @@ -30,8 +30,8 @@ import java.util.LinkedList; import java.util.List; import java.util.Vector; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.convert.ConversionFailedException; import org.springframework.core.convert.ConverterNotFoundException; @@ -53,7 +53,7 @@ public class CollectionToCollectionConverterTests { private GenericConversionService conversionService = new GenericConversionService(); - @Before + @BeforeEach public void setUp() { conversionService.addConverter(new CollectionToCollectionConverter(conversionService)); } diff --git a/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java b/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java index 9d0dc8897e2..4a23322014f 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.convert.ConversionFailedException; import org.springframework.core.convert.ConverterNotFoundException; diff --git a/spring-core/src/test/java/org/springframework/core/convert/support/MapToMapConverterTests.java b/spring-core/src/test/java/org/springframework/core/convert/support/MapToMapConverterTests.java index c6f3a4ffa21..9284af61bbc 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/support/MapToMapConverterTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/support/MapToMapConverterTests.java @@ -24,8 +24,8 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.convert.ConversionFailedException; import org.springframework.core.convert.ConverterNotFoundException; @@ -46,7 +46,7 @@ public class MapToMapConverterTests { private final GenericConversionService conversionService = new GenericConversionService(); - @Before + @BeforeEach public void setUp() { conversionService.addConverter(new MapToMapConverter(conversionService)); } diff --git a/spring-core/src/test/java/org/springframework/core/convert/support/StreamConverterTests.java b/spring-core/src/test/java/org/springframework/core/convert/support/StreamConverterTests.java index 51c0f91ef80..e8b32a7e597 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/support/StreamConverterTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/support/StreamConverterTests.java @@ -20,8 +20,8 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Stream; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.convert.ConversionFailedException; import org.springframework.core.convert.ConverterNotFoundException; @@ -45,7 +45,7 @@ public class StreamConverterTests { private final StreamConverter streamConverter = new StreamConverter(this.conversionService); - @Before + @BeforeEach public void setup() { this.conversionService.addConverter(new CollectionToCollectionConverter(this.conversionService)); this.conversionService.addConverter(new ArrayToCollectionConverter(this.conversionService)); diff --git a/spring-core/src/test/java/org/springframework/core/env/CompositePropertySourceTests.java b/spring-core/src/test/java/org/springframework/core/env/CompositePropertySourceTests.java index d8bf59477a9..11936a0fe41 100644 --- a/spring-core/src/test/java/org/springframework/core/env/CompositePropertySourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/CompositePropertySourceTests.java @@ -18,7 +18,7 @@ package org.springframework.core.env; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/env/CustomEnvironmentTests.java b/spring-core/src/test/java/org/springframework/core/env/CustomEnvironmentTests.java index 5fc88c6ddea..a768c6f5ac8 100644 --- a/spring-core/src/test/java/org/springframework/core/env/CustomEnvironmentTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/CustomEnvironmentTests.java @@ -20,7 +20,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/env/JOptCommandLinePropertySourceTests.java b/spring-core/src/test/java/org/springframework/core/env/JOptCommandLinePropertySourceTests.java index 4fd3e34ba1c..1183ef01420 100644 --- a/spring-core/src/test/java/org/springframework/core/env/JOptCommandLinePropertySourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/JOptCommandLinePropertySourceTests.java @@ -20,7 +20,7 @@ import java.util.Arrays; import joptsimple.OptionParser; import joptsimple.OptionSet; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/env/MutablePropertySourcesTests.java b/spring-core/src/test/java/org/springframework/core/env/MutablePropertySourcesTests.java index b0e9bd30945..5fa1fd58f74 100644 --- a/spring-core/src/test/java/org/springframework/core/env/MutablePropertySourcesTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/MutablePropertySourcesTests.java @@ -18,7 +18,7 @@ package org.springframework.core.env; import java.util.Iterator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.mock.env.MockPropertySource; diff --git a/spring-core/src/test/java/org/springframework/core/env/ProfilesTests.java b/spring-core/src/test/java/org/springframework/core/env/ProfilesTests.java index 6e6c39b80bd..3767916ea0f 100644 --- a/spring-core/src/test/java/org/springframework/core/env/ProfilesTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/ProfilesTests.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.function.Predicate; import java.util.function.Supplier; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.util.StringUtils; diff --git a/spring-core/src/test/java/org/springframework/core/env/PropertySourceTests.java b/spring-core/src/test/java/org/springframework/core/env/PropertySourceTests.java index 3290b0ad925..f255abff357 100644 --- a/spring-core/src/test/java/org/springframework/core/env/PropertySourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/PropertySourceTests.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/env/PropertySourcesPropertyResolverTests.java b/spring-core/src/test/java/org/springframework/core/env/PropertySourcesPropertyResolverTests.java index 6a665d94298..a6b6b76a6c4 100644 --- a/spring-core/src/test/java/org/springframework/core/env/PropertySourcesPropertyResolverTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/PropertySourcesPropertyResolverTests.java @@ -20,8 +20,8 @@ import java.util.HashMap; import java.util.Map; import java.util.Properties; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.core.convert.ConverterNotFoundException; import org.springframework.mock.env.MockPropertySource; @@ -44,7 +44,7 @@ public class PropertySourcesPropertyResolverTests { private ConfigurablePropertyResolver propertyResolver; - @Before + @BeforeEach public void setUp() { propertySources = new MutablePropertySources(); propertyResolver = new PropertySourcesPropertyResolver(propertySources); diff --git a/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLineParserTests.java b/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLineParserTests.java index e87ffb1c591..25be04bab37 100644 --- a/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLineParserTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLineParserTests.java @@ -19,7 +19,7 @@ package org.springframework.core.env; import java.util.Collections; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLinePropertySourceTests.java b/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLinePropertySourceTests.java index fbc22ee87a2..676c19a7818 100644 --- a/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLinePropertySourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/SimpleCommandLinePropertySourceTests.java @@ -18,7 +18,7 @@ package org.springframework.core.env; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java b/spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java index 2bb709a3043..ac7f7153198 100644 --- a/spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java @@ -23,7 +23,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.SpringProperties; import org.springframework.mock.env.MockPropertySource; diff --git a/spring-core/src/test/java/org/springframework/core/env/SystemEnvironmentPropertySourceTests.java b/spring-core/src/test/java/org/springframework/core/env/SystemEnvironmentPropertySourceTests.java index 51a35f7dda0..598027ac3fb 100644 --- a/spring-core/src/test/java/org/springframework/core/env/SystemEnvironmentPropertySourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/SystemEnvironmentPropertySourceTests.java @@ -21,8 +21,8 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -41,7 +41,7 @@ public class SystemEnvironmentPropertySourceTests { private PropertySource ps; - @Before + @BeforeEach public void setUp() { envMap = new HashMap<>(); ps = new SystemEnvironmentPropertySource("sysEnv", envMap); diff --git a/spring-core/src/test/java/org/springframework/core/io/ClassPathResourceTests.java b/spring-core/src/test/java/org/springframework/core/io/ClassPathResourceTests.java index d81b5efcece..8678178ad88 100644 --- a/spring-core/src/test/java/org/springframework/core/io/ClassPathResourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/ClassPathResourceTests.java @@ -20,7 +20,7 @@ import java.io.FileNotFoundException; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/core/io/PathResourceTests.java b/spring-core/src/test/java/org/springframework/core/io/PathResourceTests.java index abf88c8450f..2c318727252 100644 --- a/spring-core/src/test/java/org/springframework/core/io/PathResourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/PathResourceTests.java @@ -25,12 +25,12 @@ import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; import java.nio.charset.StandardCharsets; import java.nio.file.AccessDeniedException; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.springframework.util.FileCopyUtils; @@ -68,10 +68,6 @@ public class PathResourceTests { } - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - - @Test public void nullPath() { assertThatIllegalArgumentException().isThrownBy(() -> @@ -270,15 +266,15 @@ public class PathResourceTests { } @Test - public void outputStream() throws IOException { - PathResource resource = new PathResource(temporaryFolder.newFile("test").toPath()); + public void outputStream(@TempDir Path temporaryFolder) throws IOException { + PathResource resource = new PathResource(temporaryFolder.resolve("test")); FileCopyUtils.copy("test".getBytes(StandardCharsets.UTF_8), resource.getOutputStream()); assertThat(resource.contentLength()).isEqualTo(4L); } @Test - public void doesNotExistOutputStream() throws IOException { - File file = temporaryFolder.newFile("test"); + public void doesNotExistOutputStream(@TempDir Path temporaryFolder) throws IOException { + File file = temporaryFolder.resolve("test").toFile(); file.delete(); PathResource resource = new PathResource(file.toPath()); FileCopyUtils.copy("test".getBytes(), resource.getOutputStream()); @@ -329,8 +325,10 @@ public class PathResourceTests { } @Test - public void getWritableChannel() throws IOException { - PathResource resource = new PathResource(temporaryFolder.newFile("test").toPath()); + public void getWritableChannel(@TempDir Path temporaryFolder) throws IOException { + Path testPath = temporaryFolder.resolve("test"); + Files.createFile(testPath); + PathResource resource = new PathResource(testPath); ByteBuffer buffer = ByteBuffer.wrap("test".getBytes(StandardCharsets.UTF_8)); WritableByteChannel channel = null; try { diff --git a/spring-core/src/test/java/org/springframework/core/io/ResourceEditorTests.java b/spring-core/src/test/java/org/springframework/core/io/ResourceEditorTests.java index 14d17940551..22685539a8c 100644 --- a/spring-core/src/test/java/org/springframework/core/io/ResourceEditorTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/ResourceEditorTests.java @@ -18,7 +18,7 @@ package org.springframework.core.io; import java.beans.PropertyEditor; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.env.StandardEnvironment; diff --git a/spring-core/src/test/java/org/springframework/core/io/ResourceTests.java b/spring-core/src/test/java/org/springframework/core/io/ResourceTests.java index 9af391bfbfc..b6ff18c36ab 100644 --- a/spring-core/src/test/java/org/springframework/core/io/ResourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/ResourceTests.java @@ -28,7 +28,7 @@ import java.nio.file.Paths; import java.util.HashSet; import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.util.FileCopyUtils; diff --git a/spring-core/src/test/java/org/springframework/core/io/buffer/AbstractLeakCheckingTestCase.java b/spring-core/src/test/java/org/springframework/core/io/buffer/AbstractLeakCheckingTestCase.java index 29ac68720e0..5af66bf2695 100644 --- a/spring-core/src/test/java/org/springframework/core/io/buffer/AbstractLeakCheckingTestCase.java +++ b/spring-core/src/test/java/org/springframework/core/io/buffer/AbstractLeakCheckingTestCase.java @@ -16,7 +16,7 @@ package org.springframework.core.io.buffer; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; /** * Abstract base class for unit tests that allocate data buffers via a {@link DataBufferFactory}. @@ -39,7 +39,7 @@ public abstract class AbstractLeakCheckingTestCase { * Checks whether any of the data buffers created by {@link #bufferFactory} have not been * released, throwing an assertion error if so. */ - @After + @AfterEach public final void checkForLeaks() { this.bufferFactory.checkForLeaks(); } diff --git a/spring-core/src/test/java/org/springframework/core/io/buffer/LeakAwareDataBufferFactory.java b/spring-core/src/test/java/org/springframework/core/io/buffer/LeakAwareDataBufferFactory.java index 0486b89a035..7a65300e924 100644 --- a/spring-core/src/test/java/org/springframework/core/io/buffer/LeakAwareDataBufferFactory.java +++ b/spring-core/src/test/java/org/springframework/core/io/buffer/LeakAwareDataBufferFactory.java @@ -27,16 +27,16 @@ import io.netty.buffer.PooledByteBufAllocator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jetbrains.annotations.NotNull; -import org.junit.After; import org.springframework.util.Assert; /** - * Implementation of the {@code DataBufferFactory} interface that keep track of memory leaks. - * Useful for unit tests that handle data buffers. Simply inherit from + * Implementation of the {@code DataBufferFactory} interface that keeps track of + * memory leaks. + *

Useful for unit tests that handle data buffers. Simply inherit from * {@link AbstractLeakCheckingTestCase} or call {@link #checkForLeaks()} in - * a JUnit {@link After} method yourself, and any buffers have not been released will result in an - * {@link AssertionError}. + * a JUnit after method yourself, and any buffers that have not been + * released will result in an {@link AssertionError}. * * @author Arjen Poutsma * @see LeakAwareDataBufferFactory @@ -71,7 +71,7 @@ public class LeakAwareDataBufferFactory implements DataBufferFactory { /** * Checks whether all of the data buffers allocated by this factory have also been released. - * If not, then an {@link AssertionError} is thrown. Typically used from a JUnit {@link After} + * If not, then an {@link AssertionError} is thrown. Typically used from a JUnit after * method. */ public void checkForLeaks() { diff --git a/spring-core/src/test/java/org/springframework/core/io/buffer/LeakAwareDataBufferFactoryTests.java b/spring-core/src/test/java/org/springframework/core/io/buffer/LeakAwareDataBufferFactoryTests.java index 9fe4f0821a3..5df94eba4bb 100644 --- a/spring-core/src/test/java/org/springframework/core/io/buffer/LeakAwareDataBufferFactoryTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/buffer/LeakAwareDataBufferFactoryTests.java @@ -16,7 +16,7 @@ package org.springframework.core.io.buffer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.springframework.core.io.buffer.DataBufferUtils.release; diff --git a/spring-core/src/test/java/org/springframework/core/io/support/EncodedResourceTests.java b/spring-core/src/test/java/org/springframework/core/io/support/EncodedResourceTests.java index cc50b0a031d..55fe80121a8 100644 --- a/spring-core/src/test/java/org/springframework/core/io/support/EncodedResourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/support/EncodedResourceTests.java @@ -18,7 +18,7 @@ package org.springframework.core.io.support; import java.nio.charset.Charset; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.io.DescriptiveResource; import org.springframework.core.io.Resource; diff --git a/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java b/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java index 2a1c7073d39..3b0cfd5cca0 100644 --- a/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java @@ -22,8 +22,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.springframework.core.io.Resource; import org.springframework.util.StringUtils; @@ -79,7 +79,7 @@ public class PathMatchingResourcePatternResolverTests { assertProtocolAndFilenames(resources, "jar", "Publisher.class"); } - @Ignore // passes under Eclipse, fails under Ant + @Disabled @Test public void classpathStarWithPatternOnFileSystem() throws IOException { Resource[] resources = resolver.getResources("classpath*:org/springframework/core/io/sup*/*.class"); diff --git a/spring-core/src/test/java/org/springframework/core/io/support/ResourceArrayPropertyEditorTests.java b/spring-core/src/test/java/org/springframework/core/io/support/ResourceArrayPropertyEditorTests.java index 0402bbd0ccf..e72759f08d5 100644 --- a/spring-core/src/test/java/org/springframework/core/io/support/ResourceArrayPropertyEditorTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/support/ResourceArrayPropertyEditorTests.java @@ -18,7 +18,7 @@ package org.springframework.core.io.support; import java.beans.PropertyEditor; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.env.StandardEnvironment; import org.springframework.core.io.Resource; diff --git a/spring-core/src/test/java/org/springframework/core/io/support/ResourcePropertySourceTests.java b/spring-core/src/test/java/org/springframework/core/io/support/ResourcePropertySourceTests.java index d7592047efd..6f12bc15468 100644 --- a/spring-core/src/test/java/org/springframework/core/io/support/ResourcePropertySourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/support/ResourcePropertySourceTests.java @@ -18,7 +18,7 @@ package org.springframework.core.io.support; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.env.PropertySource; import org.springframework.core.io.ByteArrayResource; diff --git a/spring-core/src/test/java/org/springframework/core/io/support/ResourceRegionTests.java b/spring-core/src/test/java/org/springframework/core/io/support/ResourceRegionTests.java index 519aa3da641..2529d4fba0c 100644 --- a/spring-core/src/test/java/org/springframework/core/io/support/ResourceRegionTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/support/ResourceRegionTests.java @@ -16,7 +16,7 @@ package org.springframework.core.io.support; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.io.Resource; diff --git a/spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java b/spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java index c8a023701f1..85a0e0eff92 100644 --- a/spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/support/SpringFactoriesLoaderTests.java @@ -19,7 +19,7 @@ package org.springframework.core.io.support; import java.lang.reflect.Modifier; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/core/log/LogSupportTests.java b/spring-core/src/test/java/org/springframework/core/log/LogSupportTests.java index aa9908b08b0..05e3f93d275 100644 --- a/spring-core/src/test/java/org/springframework/core/log/LogSupportTests.java +++ b/spring-core/src/test/java/org/springframework/core/log/LogSupportTests.java @@ -16,7 +16,7 @@ package org.springframework.core.log; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/serializer/SerializationConverterTests.java b/spring-core/src/test/java/org/springframework/core/serializer/SerializationConverterTests.java index 392b37bd315..e993a0459c0 100644 --- a/spring-core/src/test/java/org/springframework/core/serializer/SerializationConverterTests.java +++ b/spring-core/src/test/java/org/springframework/core/serializer/SerializationConverterTests.java @@ -19,7 +19,7 @@ package org.springframework.core.serializer; import java.io.NotSerializableException; import java.io.Serializable; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.serializer.support.DeserializingConverter; import org.springframework.core.serializer.support.SerializationFailedException; diff --git a/spring-core/src/test/java/org/springframework/core/style/DefaultValueStylerTests.java b/spring-core/src/test/java/org/springframework/core/style/DefaultValueStylerTests.java index 30c88c68cb1..d62db656058 100644 --- a/spring-core/src/test/java/org/springframework/core/style/DefaultValueStylerTests.java +++ b/spring-core/src/test/java/org/springframework/core/style/DefaultValueStylerTests.java @@ -24,7 +24,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/style/ToStringCreatorTests.java b/spring-core/src/test/java/org/springframework/core/style/ToStringCreatorTests.java index 21a8450d27e..782e6227fd9 100644 --- a/spring-core/src/test/java/org/springframework/core/style/ToStringCreatorTests.java +++ b/spring-core/src/test/java/org/springframework/core/style/ToStringCreatorTests.java @@ -23,8 +23,8 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.util.ObjectUtils; @@ -38,7 +38,7 @@ public class ToStringCreatorTests { private SomeObject s1, s2, s3; - @Before + @BeforeEach public void setUp() throws Exception { s1 = new SomeObject() { @Override diff --git a/spring-core/src/test/java/org/springframework/core/task/SimpleAsyncTaskExecutorTests.java b/spring-core/src/test/java/org/springframework/core/task/SimpleAsyncTaskExecutorTests.java index ebaf6d8abd8..fcd6fa7d48d 100644 --- a/spring-core/src/test/java/org/springframework/core/task/SimpleAsyncTaskExecutorTests.java +++ b/spring-core/src/test/java/org/springframework/core/task/SimpleAsyncTaskExecutorTests.java @@ -18,7 +18,7 @@ package org.springframework.core.task; import java.util.concurrent.ThreadFactory; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.util.ConcurrencyThrottleSupport; diff --git a/spring-core/src/test/java/org/springframework/core/type/AbstractAnnotationMetadataTests.java b/spring-core/src/test/java/org/springframework/core/type/AbstractAnnotationMetadataTests.java index c8ce781995e..0f088c0f6ce 100644 --- a/spring-core/src/test/java/org/springframework/core/type/AbstractAnnotationMetadataTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/AbstractAnnotationMetadataTests.java @@ -19,7 +19,7 @@ package org.springframework.core.type; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.annotation.MergedAnnotation; import org.springframework.core.type.AbstractAnnotationMetadataTests.TestMemberClass.TestMemberClassInnerClass; diff --git a/spring-core/src/test/java/org/springframework/core/type/AbstractClassMetadataMemberClassTests.java b/spring-core/src/test/java/org/springframework/core/type/AbstractClassMetadataMemberClassTests.java index 24fd1b5186c..b3b9a806953 100644 --- a/spring-core/src/test/java/org/springframework/core/type/AbstractClassMetadataMemberClassTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/AbstractClassMetadataMemberClassTests.java @@ -16,7 +16,7 @@ package org.springframework.core.type; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/core/type/AbstractMethodMetadataTests.java b/spring-core/src/test/java/org/springframework/core/type/AbstractMethodMetadataTests.java index 3699348d2d6..52cf875eb52 100644 --- a/spring-core/src/test/java/org/springframework/core/type/AbstractMethodMetadataTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/AbstractMethodMetadataTests.java @@ -19,7 +19,7 @@ package org.springframework.core.type; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.annotation.MergedAnnotation; import org.springframework.util.MultiValueMap; diff --git a/spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java b/spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java index b34ae869c05..9944af3d738 100644 --- a/spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java @@ -29,7 +29,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.annotation.AliasFor; import org.springframework.core.annotation.AnnotationAttributes; diff --git a/spring-core/src/test/java/org/springframework/core/type/AnnotationTypeFilterTests.java b/spring-core/src/test/java/org/springframework/core/type/AnnotationTypeFilterTests.java index 53dcf5e4242..a6f0715191e 100644 --- a/spring-core/src/test/java/org/springframework/core/type/AnnotationTypeFilterTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/AnnotationTypeFilterTests.java @@ -20,7 +20,7 @@ import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.type.classreading.MetadataReader; import org.springframework.core.type.classreading.MetadataReaderFactory; @@ -34,13 +34,15 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Ramnivas Laddad * @author Juergen Hoeller * @author Oliver Gierke + * @author Sam Brannen + * @see AnnotationTypeFilterTestsTypes */ public class AnnotationTypeFilterTests { @Test public void testDirectAnnotationMatch() throws Exception { MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(); - String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeComponent"; + String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTestsTypes$SomeComponent"; MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(classUnderTest); AnnotationTypeFilter filter = new AnnotationTypeFilter(InheritedAnnotation.class); @@ -51,7 +53,7 @@ public class AnnotationTypeFilterTests { @Test public void testInheritedAnnotationFromInterfaceDoesNotMatch() throws Exception { MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(); - String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeClassWithSomeComponentInterface"; + String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTestsTypes$SomeClassWithSomeComponentInterface"; MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(classUnderTest); AnnotationTypeFilter filter = new AnnotationTypeFilter(InheritedAnnotation.class); @@ -63,7 +65,7 @@ public class AnnotationTypeFilterTests { @Test public void testInheritedAnnotationFromBaseClassDoesMatch() throws Exception { MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(); - String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeSubclassOfSomeComponent"; + String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTestsTypes$SomeSubclassOfSomeComponent"; MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(classUnderTest); AnnotationTypeFilter filter = new AnnotationTypeFilter(InheritedAnnotation.class); @@ -74,7 +76,7 @@ public class AnnotationTypeFilterTests { @Test public void testNonInheritedAnnotationDoesNotMatch() throws Exception { MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(); - String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeSubclassOfSomeClassMarkedWithNonInheritedAnnotation"; + String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTestsTypes$SomeSubclassOfSomeClassMarkedWithNonInheritedAnnotation"; MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(classUnderTest); AnnotationTypeFilter filter = new AnnotationTypeFilter(NonInheritedAnnotation.class); @@ -86,7 +88,7 @@ public class AnnotationTypeFilterTests { @Test public void testNonAnnotatedClassDoesntMatch() throws Exception { MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(); - String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeNonCandidateClass"; + String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTestsTypes$SomeNonCandidateClass"; MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(classUnderTest); AnnotationTypeFilter filter = new AnnotationTypeFilter(Component.class); @@ -97,7 +99,7 @@ public class AnnotationTypeFilterTests { @Test public void testMatchesInterfacesIfConfigured() throws Exception { MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(); - String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTests$SomeClassWithSomeComponentInterface"; + String classUnderTest = "org.springframework.core.type.AnnotationTypeFilterTestsTypes$SomeClassWithSomeComponentInterface"; MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(classUnderTest); AnnotationTypeFilter filter = new AnnotationTypeFilter(InheritedAnnotation.class, false, true); @@ -105,53 +107,13 @@ public class AnnotationTypeFilterTests { ClassloadingAssertions.assertClassNotLoaded(classUnderTest); } - - // We must use a standalone set of types to ensure that no one else is loading them - // and interfering with ClassloadingAssertions.assertClassNotLoaded() - @Inherited @Retention(RetentionPolicy.RUNTIME) - private @interface InheritedAnnotation { + @interface InheritedAnnotation { } - - @InheritedAnnotation - private static class SomeComponent { - } - - - @InheritedAnnotation - private interface SomeComponentInterface { - } - - - @SuppressWarnings("unused") - private static class SomeClassWithSomeComponentInterface implements Cloneable, SomeComponentInterface { - } - - - @SuppressWarnings("unused") - private static class SomeSubclassOfSomeComponent extends SomeComponent { - } - - @Retention(RetentionPolicy.RUNTIME) - private @interface NonInheritedAnnotation { - } - - - @NonInheritedAnnotation - private static class SomeClassMarkedWithNonInheritedAnnotation { - } - - - @SuppressWarnings("unused") - private static class SomeSubclassOfSomeClassMarkedWithNonInheritedAnnotation extends SomeClassMarkedWithNonInheritedAnnotation { - } - - - @SuppressWarnings("unused") - private static class SomeNonCandidateClass { + @interface NonInheritedAnnotation { } } diff --git a/spring-core/src/test/java/org/springframework/core/type/AnnotationTypeFilterTestsTypes.java b/spring-core/src/test/java/org/springframework/core/type/AnnotationTypeFilterTestsTypes.java new file mode 100644 index 00000000000..32e72c30e54 --- /dev/null +++ b/spring-core/src/test/java/org/springframework/core/type/AnnotationTypeFilterTestsTypes.java @@ -0,0 +1,64 @@ +/* + * Copyright 2002-2019 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.type; + +/** + * We must use a standalone set of types to ensure that no one else is loading + * them and interfering with {@link ClassloadingAssertions#assertClassNotLoaded(String)}. + * + * @author Ramnivas Laddad + * @author Juergen Hoeller + * @author Oliver Gierke + * @author Sam Brannen + * @see AnnotationTypeFilterTests + */ +class AnnotationTypeFilterTestsTypes { + + @AnnotationTypeFilterTests.InheritedAnnotation + private static class SomeComponent { + } + + + @AnnotationTypeFilterTests.InheritedAnnotation + private interface SomeComponentInterface { + } + + + @SuppressWarnings("unused") + private static class SomeClassWithSomeComponentInterface implements Cloneable, SomeComponentInterface { + } + + + @SuppressWarnings("unused") + private static class SomeSubclassOfSomeComponent extends SomeComponent { + } + + @AnnotationTypeFilterTests.NonInheritedAnnotation + private static class SomeClassMarkedWithNonInheritedAnnotation { + } + + + @SuppressWarnings("unused") + private static class SomeSubclassOfSomeClassMarkedWithNonInheritedAnnotation extends SomeClassMarkedWithNonInheritedAnnotation { + } + + + @SuppressWarnings("unused") + private static class SomeNonCandidateClass { + } + +} diff --git a/spring-core/src/test/java/org/springframework/core/type/AspectJTypeFilterTests.java b/spring-core/src/test/java/org/springframework/core/type/AspectJTypeFilterTests.java index 0e32d6315a7..2184f9f2e72 100644 --- a/spring-core/src/test/java/org/springframework/core/type/AspectJTypeFilterTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/AspectJTypeFilterTests.java @@ -16,113 +16,114 @@ package org.springframework.core.type; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.type.classreading.MetadataReader; import org.springframework.core.type.classreading.MetadataReaderFactory; import org.springframework.core.type.classreading.SimpleMetadataReaderFactory; import org.springframework.core.type.filter.AspectJTypeFilter; -import org.springframework.stereotype.Component; import static org.assertj.core.api.Assertions.assertThat; /** * @author Ramnivas Laddad + * @author Sam Brannen + * @see AspectJTypeFilterTestsTypes */ public class AspectJTypeFilterTests { @Test public void namePatternMatches() throws Exception { - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClass", - "org.springframework.core.type.AspectJTypeFilterTests.SomeClass"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClass", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClass", + "org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeClass"); + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClass", "*"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClass", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClass", "*..SomeClass"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClass", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClass", "org..SomeClass"); } @Test public void namePatternNoMatches() throws Exception { - assertNoMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClass", - "org.springframework.core.type.AspectJTypeFilterTests.SomeClassX"); + assertNoMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClass", + "org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeClassX"); } @Test public void subclassPatternMatches() throws Exception { - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClass", - "org.springframework.core.type.AspectJTypeFilterTests.SomeClass+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClass", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClass", + "org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeClass+"); + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClass", "*+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClass", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClass", "java.lang.Object+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassImplementingSomeInterface", - "org.springframework.core.type.AspectJTypeFilterTests.SomeInterface+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassImplementingSomeInterface", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassImplementingSomeInterface", + "org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeInterface+"); + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassImplementingSomeInterface", "*+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassImplementingSomeInterface", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassImplementingSomeInterface", "java.lang.Object+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", - "org.springframework.core.type.AspectJTypeFilterTests.SomeInterface+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", - "org.springframework.core.type.AspectJTypeFilterTests.SomeClassExtendingSomeClass+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", - "org.springframework.core.type.AspectJTypeFilterTests.SomeClass+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", + "org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeInterface+"); + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", + "org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeClassExtendingSomeClass+"); + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", + "org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeClass+"); + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", "*+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", "java.lang.Object+"); } @Test public void subclassPatternNoMatches() throws Exception { - assertNoMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClass", + assertNoMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClass", "java.lang.String+"); } @Test public void annotationPatternMatches() throws Exception { - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassAnnotatedWithComponent", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassAnnotatedWithComponent", "@org.springframework.stereotype.Component *..*"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassAnnotatedWithComponent", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassAnnotatedWithComponent", "@* *..*"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassAnnotatedWithComponent", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassAnnotatedWithComponent", "@*..* *..*"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassAnnotatedWithComponent", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassAnnotatedWithComponent", "@*..*Component *..*"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassAnnotatedWithComponent", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassAnnotatedWithComponent", "@org.springframework.stereotype.Component *..*Component"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassAnnotatedWithComponent", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassAnnotatedWithComponent", "@org.springframework.stereotype.Component *"); } @Test public void annotationPatternNoMatches() throws Exception { - assertNoMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassAnnotatedWithComponent", + assertNoMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassAnnotatedWithComponent", "@org.springframework.stereotype.Repository *..*"); } @Test public void compositionPatternMatches() throws Exception { - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClass", + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClass", "!*..SomeOtherClass"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", - "org.springframework.core.type.AspectJTypeFilterTests.SomeInterface+ " + - "&& org.springframework.core.type.AspectJTypeFilterTests.SomeClass+ " + - "&& org.springframework.core.type.AspectJTypeFilterTests.SomeClassExtendingSomeClass+"); - assertMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", - "org.springframework.core.type.AspectJTypeFilterTests.SomeInterface+ " + - "|| org.springframework.core.type.AspectJTypeFilterTests.SomeClass+ " + - "|| org.springframework.core.type.AspectJTypeFilterTests.SomeClassExtendingSomeClass+"); + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", + "org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeInterface+ " + + "&& org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeClass+ " + + "&& org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeClassExtendingSomeClass+"); + assertMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface", + "org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeInterface+ " + + "|| org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeClass+ " + + "|| org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeClassExtendingSomeClass+"); } @Test public void compositionPatternNoMatches() throws Exception { - assertNoMatch("org.springframework.core.type.AspectJTypeFilterTests$SomeClass", - "*..Bogus && org.springframework.core.type.AspectJTypeFilterTests.SomeClass"); + assertNoMatch("org.springframework.core.type.AspectJTypeFilterTestsTypes$SomeClass", + "*..Bogus && org.springframework.core.type.AspectJTypeFilterTestsTypes.SomeClass"); } private void assertMatch(String type, String typePattern) throws Exception { @@ -143,27 +144,4 @@ public class AspectJTypeFilterTests { ClassloadingAssertions.assertClassNotLoaded(type); } - - // We must use a standalone set of types to ensure that no one else is loading them - // and interfering with ClassloadingAssertions.assertClassNotLoaded() - interface SomeInterface { - } - - static class SomeClass { - } - - static class SomeClassExtendingSomeClass extends SomeClass { - } - - static class SomeClassImplementingSomeInterface implements SomeInterface { - } - - static class SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface - extends SomeClassExtendingSomeClass implements SomeInterface { - } - - @Component - static class SomeClassAnnotatedWithComponent { - } - } diff --git a/spring-core/src/test/java/org/springframework/core/type/AspectJTypeFilterTestsTypes.java b/spring-core/src/test/java/org/springframework/core/type/AspectJTypeFilterTestsTypes.java new file mode 100644 index 00000000000..d0931304dc3 --- /dev/null +++ b/spring-core/src/test/java/org/springframework/core/type/AspectJTypeFilterTestsTypes.java @@ -0,0 +1,51 @@ +/* + * Copyright 2002-2019 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.type; + +import org.springframework.stereotype.Component; + +/** + * We must use a standalone set of types to ensure that no one else is loading + * them and interfering with {@link ClassloadingAssertions#assertClassNotLoaded(String)}. + * + * @author Ramnivas Laddad + * @author Sam Brannen + * @see AspectJTypeFilterTests + */ +public class AspectJTypeFilterTestsTypes { + + interface SomeInterface { + } + + static class SomeClass { + } + + static class SomeClassExtendingSomeClass extends SomeClass { + } + + static class SomeClassImplementingSomeInterface implements SomeInterface { + } + + static class SomeClassExtendingSomeClassExtendingSomeClassAndImplementingSomeInterface + extends SomeClassExtendingSomeClass implements SomeInterface { + } + + @Component + static class SomeClassAnnotatedWithComponent { + } + +} diff --git a/spring-core/src/test/java/org/springframework/core/type/AssignableTypeFilterTests.java b/spring-core/src/test/java/org/springframework/core/type/AssignableTypeFilterTests.java index 5518ebf9e94..cb131d92e3b 100644 --- a/spring-core/src/test/java/org/springframework/core/type/AssignableTypeFilterTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/AssignableTypeFilterTests.java @@ -16,7 +16,7 @@ package org.springframework.core.type; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.type.classreading.MetadataReader; import org.springframework.core.type.classreading.MetadataReaderFactory; @@ -28,17 +28,18 @@ import static org.assertj.core.api.Assertions.assertThat; /** * @author Ramnivas Laddad * @author Juergen Hoeller + * @see AssignableTypeFilterTestsTypes */ public class AssignableTypeFilterTests { @Test public void directMatch() throws Exception { MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(); - String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTests$TestNonInheritingClass"; + String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTestsTypes$TestNonInheritingClass"; MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(classUnderTest); - AssignableTypeFilter matchingFilter = new AssignableTypeFilter(TestNonInheritingClass.class); - AssignableTypeFilter notMatchingFilter = new AssignableTypeFilter(TestInterface.class); + AssignableTypeFilter matchingFilter = new AssignableTypeFilter(AssignableTypeFilterTestsTypes.TestNonInheritingClass.class); + AssignableTypeFilter notMatchingFilter = new AssignableTypeFilter(AssignableTypeFilterTestsTypes.TestInterface.class); assertThat(notMatchingFilter.match(metadataReader, metadataReaderFactory)).isFalse(); assertThat(matchingFilter.match(metadataReader, metadataReaderFactory)).isTrue(); } @@ -46,10 +47,10 @@ public class AssignableTypeFilterTests { @Test public void interfaceMatch() throws Exception { MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(); - String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTests$TestInterfaceImpl"; + String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTestsTypes$TestInterfaceImpl"; MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(classUnderTest); - AssignableTypeFilter filter = new AssignableTypeFilter(TestInterface.class); + AssignableTypeFilter filter = new AssignableTypeFilter(AssignableTypeFilterTestsTypes.TestInterface.class); assertThat(filter.match(metadataReader, metadataReaderFactory)).isTrue(); ClassloadingAssertions.assertClassNotLoaded(classUnderTest); } @@ -57,10 +58,10 @@ public class AssignableTypeFilterTests { @Test public void superClassMatch() throws Exception { MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(); - String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTests$SomeDaoLikeImpl"; + String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTestsTypes$SomeDaoLikeImpl"; MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(classUnderTest); - AssignableTypeFilter filter = new AssignableTypeFilter(SimpleJdbcDaoSupport.class); + AssignableTypeFilter filter = new AssignableTypeFilter(AssignableTypeFilterTestsTypes.SimpleJdbcDaoSupport.class); assertThat(filter.match(metadataReader, metadataReaderFactory)).isTrue(); ClassloadingAssertions.assertClassNotLoaded(classUnderTest); } @@ -68,38 +69,12 @@ public class AssignableTypeFilterTests { @Test public void interfaceThroughSuperClassMatch() throws Exception { MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(); - String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTests$SomeDaoLikeImpl"; + String classUnderTest = "org.springframework.core.type.AssignableTypeFilterTestsTypes$SomeDaoLikeImpl"; MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(classUnderTest); - AssignableTypeFilter filter = new AssignableTypeFilter(JdbcDaoSupport.class); + AssignableTypeFilter filter = new AssignableTypeFilter(AssignableTypeFilterTestsTypes.JdbcDaoSupport.class); assertThat(filter.match(metadataReader, metadataReaderFactory)).isTrue(); ClassloadingAssertions.assertClassNotLoaded(classUnderTest); } - - // We must use a standalone set of types to ensure that no one else is loading them - // and interfere with ClassloadingAssertions.assertClassNotLoaded() - private static class TestNonInheritingClass { - } - - private interface TestInterface { - } - - @SuppressWarnings("unused") - private static class TestInterfaceImpl implements TestInterface { - } - - private interface SomeDaoLikeInterface { - } - - @SuppressWarnings("unused") - private static class SomeDaoLikeImpl extends SimpleJdbcDaoSupport implements SomeDaoLikeInterface { - } - - private interface JdbcDaoSupport { - } - - private static class SimpleJdbcDaoSupport implements JdbcDaoSupport { - } - } diff --git a/spring-core/src/test/java/org/springframework/core/type/AssignableTypeFilterTestsTypes.java b/spring-core/src/test/java/org/springframework/core/type/AssignableTypeFilterTestsTypes.java new file mode 100644 index 00000000000..c86b23a1c32 --- /dev/null +++ b/spring-core/src/test/java/org/springframework/core/type/AssignableTypeFilterTestsTypes.java @@ -0,0 +1,51 @@ +/* + * Copyright 2002-2019 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.type; + +/** + * We must use a standalone set of types to ensure that no one else is loading + * them and interfering with {@link ClassloadingAssertions#assertClassNotLoaded(String)}. + * + * @author Ramnivas Laddad + * @author Juergen Hoeller + * @author Sam Brannen + * @see AssignableTypeFilterTests + */ +class AssignableTypeFilterTestsTypes { + + static class TestNonInheritingClass { + } + + interface TestInterface { + } + + static class TestInterfaceImpl implements TestInterface { + } + + interface SomeDaoLikeInterface { + } + + static class SomeDaoLikeImpl extends SimpleJdbcDaoSupport implements SomeDaoLikeInterface { + } + + interface JdbcDaoSupport { + } + + static class SimpleJdbcDaoSupport implements JdbcDaoSupport { + } + +} diff --git a/spring-core/src/test/java/org/springframework/core/type/CachingMetadataReaderLeakTests.java b/spring-core/src/test/java/org/springframework/core/type/CachingMetadataReaderLeakTests.java index 88092c515ca..ef2e36e7270 100644 --- a/spring-core/src/test/java/org/springframework/core/type/CachingMetadataReaderLeakTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/CachingMetadataReaderLeakTests.java @@ -18,7 +18,7 @@ package org.springframework.core.type; import java.net.URL; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; diff --git a/spring-core/src/test/java/org/springframework/core/type/classreading/MergedAnnotationMetadataVisitorTests.java b/spring-core/src/test/java/org/springframework/core/type/classreading/MergedAnnotationMetadataVisitorTests.java index e2e68e27c15..6fe33d1a666 100644 --- a/spring-core/src/test/java/org/springframework/core/type/classreading/MergedAnnotationMetadataVisitorTests.java +++ b/spring-core/src/test/java/org/springframework/core/type/classreading/MergedAnnotationMetadataVisitorTests.java @@ -22,7 +22,7 @@ import java.io.OutputStream; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.asm.AnnotationVisitor; import org.springframework.asm.ClassReader; diff --git a/spring-core/src/test/java/org/springframework/tests/AssumeTests.java b/spring-core/src/test/java/org/springframework/tests/AssumeTests.java index 23567407b23..9bae15a305b 100644 --- a/spring-core/src/test/java/org/springframework/tests/AssumeTests.java +++ b/spring-core/src/test/java/org/springframework/tests/AssumeTests.java @@ -18,10 +18,10 @@ package org.springframework.tests; import java.util.Arrays; -import org.junit.After; import org.junit.AssumptionViolatedException; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import static java.util.stream.Collectors.joining; import static org.assertj.core.api.Assertions.assertThat; @@ -42,12 +42,12 @@ public class AssumeTests { private String originalTestGroups; - @Before + @BeforeEach public void trackOriginalTestGroups() { this.originalTestGroups = System.getProperty(TEST_GROUPS_SYSTEM_PROPERTY); } - @After + @AfterEach public void restoreOriginalTestGroups() { if (this.originalTestGroups != null) { setTestGroups(this.originalTestGroups); diff --git a/spring-core/src/test/java/org/springframework/tests/TestGroupTests.java b/spring-core/src/test/java/org/springframework/tests/TestGroupTests.java index df86e0c3e24..5ce4a40b036 100644 --- a/spring-core/src/test/java/org/springframework/tests/TestGroupTests.java +++ b/spring-core/src/test/java/org/springframework/tests/TestGroupTests.java @@ -20,7 +20,7 @@ import java.util.Collections; import java.util.EnumSet; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/AntPathMatcherTests.java b/spring-core/src/test/java/org/springframework/util/AntPathMatcherTests.java index 669b4a96f0a..e3ebf950ab4 100644 --- a/spring-core/src/test/java/org/springframework/util/AntPathMatcherTests.java +++ b/spring-core/src/test/java/org/springframework/util/AntPathMatcherTests.java @@ -23,7 +23,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/AssertTests.java b/spring-core/src/test/java/org/springframework/util/AssertTests.java index bdfc2312c3a..5d9efa67d92 100644 --- a/spring-core/src/test/java/org/springframework/util/AssertTests.java +++ b/spring-core/src/test/java/org/springframework/util/AssertTests.java @@ -20,7 +20,7 @@ import java.util.Collection; import java.util.Map; import java.util.function.Supplier; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; diff --git a/spring-core/src/test/java/org/springframework/util/AutoPopulatingListTests.java b/spring-core/src/test/java/org/springframework/util/AutoPopulatingListTests.java index 3dafedcc82c..3e5868d665c 100644 --- a/spring-core/src/test/java/org/springframework/util/AutoPopulatingListTests.java +++ b/spring-core/src/test/java/org/springframework/util/AutoPopulatingListTests.java @@ -18,7 +18,7 @@ package org.springframework.util; import java.util.LinkedList; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.tests.sample.objects.TestObject; diff --git a/spring-core/src/test/java/org/springframework/util/Base64UtilsTests.java b/spring-core/src/test/java/org/springframework/util/Base64UtilsTests.java index 836e8eff116..09ff68e1efc 100644 --- a/spring-core/src/test/java/org/springframework/util/Base64UtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/Base64UtilsTests.java @@ -19,7 +19,7 @@ package org.springframework.util; import java.io.UnsupportedEncodingException; import javax.xml.bind.DatatypeConverter; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; 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 a5d35b26923..2208e3aca74 100644 --- a/spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java @@ -29,8 +29,8 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.tests.sample.objects.DerivedTestObject; import org.springframework.tests.sample.objects.ITestInterface; @@ -50,7 +50,7 @@ public class ClassUtilsTests { private ClassLoader classLoader = getClass().getClassLoader(); - @Before + @BeforeEach public void clearStatics() { InnerClass.noArgCalled = false; InnerClass.argCalled = false; diff --git a/spring-core/src/test/java/org/springframework/util/CollectionUtilsTests.java b/spring-core/src/test/java/org/springframework/util/CollectionUtilsTests.java index d80f15a236a..4f947dc38e1 100644 --- a/spring-core/src/test/java/org/springframework/util/CollectionUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/CollectionUtilsTests.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.Properties; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/CompositeIteratorTests.java b/spring-core/src/test/java/org/springframework/util/CompositeIteratorTests.java index bf65e2e1936..a56d4e32478 100644 --- a/spring-core/src/test/java/org/springframework/util/CompositeIteratorTests.java +++ b/spring-core/src/test/java/org/springframework/util/CompositeIteratorTests.java @@ -21,7 +21,7 @@ import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/util/ConcurrentReferenceHashMapTests.java b/spring-core/src/test/java/org/springframework/util/ConcurrentReferenceHashMapTests.java index b1d47e895f5..d36447bcbdd 100644 --- a/spring-core/src/test/java/org/springframework/util/ConcurrentReferenceHashMapTests.java +++ b/spring-core/src/test/java/org/springframework/util/ConcurrentReferenceHashMapTests.java @@ -29,8 +29,8 @@ import java.util.Map; import java.util.Set; import java.util.WeakHashMap; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.springframework.lang.Nullable; import org.springframework.util.ConcurrentReferenceHashMap.Entry; @@ -487,7 +487,7 @@ public class ConcurrentReferenceHashMapTests { } @Test - @Ignore("Intended for use during development only") + @Disabled("Intended for use during development only") public void shouldBeFasterThanSynchronizedMap() throws InterruptedException { Map> synchronizedMap = Collections.synchronizedMap(new WeakHashMap>()); StopWatch mapTime = timeMultiThreaded("SynchronizedMap", synchronizedMap, v -> new WeakReference<>(String.valueOf(v))); diff --git a/spring-core/src/test/java/org/springframework/util/DigestUtilsTests.java b/spring-core/src/test/java/org/springframework/util/DigestUtilsTests.java index dfede80ce95..918e6a5cb81 100644 --- a/spring-core/src/test/java/org/springframework/util/DigestUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/DigestUtilsTests.java @@ -20,8 +20,8 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -34,7 +34,7 @@ public class DigestUtilsTests { private byte[] bytes; - @Before + @BeforeEach public void createBytes() throws UnsupportedEncodingException { bytes = "Hello World".getBytes("UTF-8"); } diff --git a/spring-core/src/test/java/org/springframework/util/ExceptionTypeFilterTests.java b/spring-core/src/test/java/org/springframework/util/ExceptionTypeFilterTests.java index 815eb60dc20..4c29f67cb93 100644 --- a/spring-core/src/test/java/org/springframework/util/ExceptionTypeFilterTests.java +++ b/spring-core/src/test/java/org/springframework/util/ExceptionTypeFilterTests.java @@ -16,7 +16,7 @@ package org.springframework.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/ExponentialBackOffTests.java b/spring-core/src/test/java/org/springframework/util/ExponentialBackOffTests.java index 3d6455180c5..b53a0120049 100644 --- a/spring-core/src/test/java/org/springframework/util/ExponentialBackOffTests.java +++ b/spring-core/src/test/java/org/springframework/util/ExponentialBackOffTests.java @@ -16,7 +16,7 @@ package org.springframework.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.util.backoff.BackOffExecution; import org.springframework.util.backoff.ExponentialBackOff; diff --git a/spring-core/src/test/java/org/springframework/util/FastByteArrayOutputStreamTests.java b/spring-core/src/test/java/org/springframework/util/FastByteArrayOutputStreamTests.java index 4b3a0192ab6..31026fb31bc 100644 --- a/spring-core/src/test/java/org/springframework/util/FastByteArrayOutputStreamTests.java +++ b/spring-core/src/test/java/org/springframework/util/FastByteArrayOutputStreamTests.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIOException; diff --git a/spring-core/src/test/java/org/springframework/util/FileCopyUtilsTests.java b/spring-core/src/test/java/org/springframework/util/FileCopyUtilsTests.java index 5a0e5e317cc..e141a85cf23 100644 --- a/spring-core/src/test/java/org/springframework/util/FileCopyUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/FileCopyUtilsTests.java @@ -23,7 +23,7 @@ import java.io.StringReader; import java.io.StringWriter; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/FileSystemUtilsTests.java b/spring-core/src/test/java/org/springframework/util/FileSystemUtilsTests.java index 7b5707755db..3a623ff94eb 100644 --- a/spring-core/src/test/java/org/springframework/util/FileSystemUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/FileSystemUtilsTests.java @@ -18,8 +18,8 @@ package org.springframework.util; import java.io.File; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -79,7 +79,7 @@ public class FileSystemUtilsTests { } - @After + @AfterEach public void tearDown() throws Exception { File tmp = new File("./tmp"); if (tmp.exists()) { diff --git a/spring-core/src/test/java/org/springframework/util/FixedBackOffTests.java b/spring-core/src/test/java/org/springframework/util/FixedBackOffTests.java index 85f12ff40de..7fde180b163 100644 --- a/spring-core/src/test/java/org/springframework/util/FixedBackOffTests.java +++ b/spring-core/src/test/java/org/springframework/util/FixedBackOffTests.java @@ -16,7 +16,7 @@ package org.springframework.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.util.backoff.BackOffExecution; import org.springframework.util.backoff.FixedBackOff; diff --git a/spring-core/src/test/java/org/springframework/util/InstanceFilterTests.java b/spring-core/src/test/java/org/springframework/util/InstanceFilterTests.java index 112670672f3..f8de4cb5161 100644 --- a/spring-core/src/test/java/org/springframework/util/InstanceFilterTests.java +++ b/spring-core/src/test/java/org/springframework/util/InstanceFilterTests.java @@ -16,7 +16,7 @@ package org.springframework.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/LinkedCaseInsensitiveMapTests.java b/spring-core/src/test/java/org/springframework/util/LinkedCaseInsensitiveMapTests.java index 092142b34ef..65a20ad9f94 100644 --- a/spring-core/src/test/java/org/springframework/util/LinkedCaseInsensitiveMapTests.java +++ b/spring-core/src/test/java/org/springframework/util/LinkedCaseInsensitiveMapTests.java @@ -18,7 +18,7 @@ package org.springframework.util; import java.util.Iterator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/LinkedMultiValueMapTests.java b/spring-core/src/test/java/org/springframework/util/LinkedMultiValueMapTests.java index 328aba93d1d..1197dd56c25 100644 --- a/spring-core/src/test/java/org/springframework/util/LinkedMultiValueMapTests.java +++ b/spring-core/src/test/java/org/springframework/util/LinkedMultiValueMapTests.java @@ -23,7 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/MethodInvokerTests.java b/spring-core/src/test/java/org/springframework/util/MethodInvokerTests.java index 463b968a1b5..93e8fbd03cf 100644 --- a/spring-core/src/test/java/org/springframework/util/MethodInvokerTests.java +++ b/spring-core/src/test/java/org/springframework/util/MethodInvokerTests.java @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/util/MimeTypeTests.java b/spring-core/src/test/java/org/springframework/util/MimeTypeTests.java index ad1890651ab..ef5db1253ee 100644 --- a/spring-core/src/test/java/org/springframework/util/MimeTypeTests.java +++ b/spring-core/src/test/java/org/springframework/util/MimeTypeTests.java @@ -22,7 +22,7 @@ import java.util.Collections; import java.util.List; import java.util.Random; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.support.DefaultConversionService; diff --git a/spring-core/src/test/java/org/springframework/util/NumberUtilsTests.java b/spring-core/src/test/java/org/springframework/util/NumberUtilsTests.java index aff5593b883..341581302e5 100644 --- a/spring-core/src/test/java/org/springframework/util/NumberUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/NumberUtilsTests.java @@ -21,7 +21,7 @@ import java.math.BigInteger; import java.text.NumberFormat; import java.util.Locale; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java b/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java index fb54e1a8241..401099ab2a2 100644 --- a/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/ObjectUtilsTests.java @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/PatternMatchUtilsTests.java b/spring-core/src/test/java/org/springframework/util/PatternMatchUtilsTests.java index a3aa5b4c6fc..fad6016cb44 100644 --- a/spring-core/src/test/java/org/springframework/util/PatternMatchUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/PatternMatchUtilsTests.java @@ -16,7 +16,7 @@ package org.springframework.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/PropertiesPersisterTests.java b/spring-core/src/test/java/org/springframework/util/PropertiesPersisterTests.java index a55b45565ce..e5a00bb7ba3 100644 --- a/spring-core/src/test/java/org/springframework/util/PropertiesPersisterTests.java +++ b/spring-core/src/test/java/org/springframework/util/PropertiesPersisterTests.java @@ -23,7 +23,7 @@ import java.io.StringReader; import java.io.StringWriter; import java.util.Properties; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/PropertyPlaceholderHelperTests.java b/spring-core/src/test/java/org/springframework/util/PropertyPlaceholderHelperTests.java index 58951b8a98b..99fb8bdab2a 100644 --- a/spring-core/src/test/java/org/springframework/util/PropertyPlaceholderHelperTests.java +++ b/spring-core/src/test/java/org/springframework/util/PropertyPlaceholderHelperTests.java @@ -18,7 +18,7 @@ package org.springframework.util; import java.util.Properties; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver; diff --git a/spring-core/src/test/java/org/springframework/util/ReflectionUtilsTests.java b/spring-core/src/test/java/org/springframework/util/ReflectionUtilsTests.java index 38e2d9ed1a8..b5ec3495ea9 100644 --- a/spring-core/src/test/java/org/springframework/util/ReflectionUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/ReflectionUtilsTests.java @@ -24,8 +24,8 @@ import java.rmi.RemoteException; import java.util.LinkedList; import java.util.List; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.springframework.tests.Assume; import org.springframework.tests.TestGroup; @@ -221,7 +221,7 @@ public class ReflectionUtilsTests { assertThat(ReflectionUtils.findMethod(B.class, "getClass")).isNotNull(); } - @Ignore("[SPR-8644] findMethod() does not currently support var-args") + @Disabled("[SPR-8644] findMethod() does not currently support var-args") @Test public void findMethodWithVarArgs() throws Exception { assertThat(ReflectionUtils.findMethod(B.class, "add", int.class, int.class, int.class)).isNotNull(); diff --git a/spring-core/src/test/java/org/springframework/util/ResizableByteArrayOutputStreamTests.java b/spring-core/src/test/java/org/springframework/util/ResizableByteArrayOutputStreamTests.java index e6ed79a4d4f..64c9f149730 100644 --- a/spring-core/src/test/java/org/springframework/util/ResizableByteArrayOutputStreamTests.java +++ b/spring-core/src/test/java/org/springframework/util/ResizableByteArrayOutputStreamTests.java @@ -16,8 +16,8 @@ package org.springframework.util; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; @@ -35,7 +35,7 @@ public class ResizableByteArrayOutputStreamTests { private byte[] helloBytes; - @Before + @BeforeEach public void setUp() throws Exception { this.baos = new ResizableByteArrayOutputStream(INITIAL_CAPACITY); this.helloBytes = "Hello World".getBytes("UTF-8"); diff --git a/spring-core/src/test/java/org/springframework/util/ResourceUtilsTests.java b/spring-core/src/test/java/org/springframework/util/ResourceUtilsTests.java index daccbf6ef24..b65a160865a 100644 --- a/spring-core/src/test/java/org/springframework/util/ResourceUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/ResourceUtilsTests.java @@ -21,7 +21,7 @@ import java.net.URL; import java.net.URLConnection; import java.net.URLStreamHandler; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/SerializationUtilsTests.java b/spring-core/src/test/java/org/springframework/util/SerializationUtilsTests.java index 158f97ada2e..049c4625950 100644 --- a/spring-core/src/test/java/org/springframework/util/SerializationUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/SerializationUtilsTests.java @@ -18,7 +18,7 @@ package org.springframework.util; import java.math.BigInteger; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/SocketUtilsTests.java b/spring-core/src/test/java/org/springframework/util/SocketUtilsTests.java index 23c30d43869..7319d634604 100644 --- a/spring-core/src/test/java/org/springframework/util/SocketUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/SocketUtilsTests.java @@ -22,7 +22,7 @@ import java.net.ServerSocket; import java.util.SortedSet; import javax.net.ServerSocketFactory; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/StopWatchTests.java b/spring-core/src/test/java/org/springframework/util/StopWatchTests.java index 0fb89c68f12..025e72fc345 100644 --- a/spring-core/src/test/java/org/springframework/util/StopWatchTests.java +++ b/spring-core/src/test/java/org/springframework/util/StopWatchTests.java @@ -16,7 +16,7 @@ package org.springframework.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.util.StopWatch.TaskInfo; diff --git a/spring-core/src/test/java/org/springframework/util/StreamUtilsTests.java b/spring-core/src/test/java/org/springframework/util/StreamUtilsTests.java index eed4b324924..7f057d2cb0b 100644 --- a/spring-core/src/test/java/org/springframework/util/StreamUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/StreamUtilsTests.java @@ -25,8 +25,8 @@ import java.util.Arrays; import java.util.Random; import java.util.UUID; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.InOrder; import static org.assertj.core.api.Assertions.assertThat; @@ -47,7 +47,7 @@ public class StreamUtilsTests { private String string = ""; - @Before + @BeforeEach public void setup() { new Random().nextBytes(bytes); while (string.length() < StreamUtils.BUFFER_SIZE + 10) { diff --git a/spring-core/src/test/java/org/springframework/util/StringUtilsTests.java b/spring-core/src/test/java/org/springframework/util/StringUtilsTests.java index fadb7542ff7..695e4015bb7 100644 --- a/spring-core/src/test/java/org/springframework/util/StringUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/StringUtilsTests.java @@ -20,7 +20,7 @@ import java.util.Arrays; import java.util.Locale; import java.util.Properties; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/SystemPropertyUtilsTests.java b/spring-core/src/test/java/org/springframework/util/SystemPropertyUtilsTests.java index 089eaf4275f..28cc1bef1e3 100644 --- a/spring-core/src/test/java/org/springframework/util/SystemPropertyUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/SystemPropertyUtilsTests.java @@ -18,7 +18,7 @@ package org.springframework.util; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/TypeUtilsTests.java b/spring-core/src/test/java/org/springframework/util/TypeUtilsTests.java index e4ecc6f3f49..df25e318e67 100644 --- a/spring-core/src/test/java/org/springframework/util/TypeUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/TypeUtilsTests.java @@ -23,7 +23,7 @@ import java.util.HashSet; import java.util.LinkedList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/comparator/BooleanComparatorTests.java b/spring-core/src/test/java/org/springframework/util/comparator/BooleanComparatorTests.java index 174309c36e6..24299107ca5 100644 --- a/spring-core/src/test/java/org/springframework/util/comparator/BooleanComparatorTests.java +++ b/spring-core/src/test/java/org/springframework/util/comparator/BooleanComparatorTests.java @@ -18,7 +18,7 @@ package org.springframework.util.comparator; import java.util.Comparator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/comparator/ComparableComparatorTests.java b/spring-core/src/test/java/org/springframework/util/comparator/ComparableComparatorTests.java index b2c87637a8d..7d3046242db 100644 --- a/spring-core/src/test/java/org/springframework/util/comparator/ComparableComparatorTests.java +++ b/spring-core/src/test/java/org/springframework/util/comparator/ComparableComparatorTests.java @@ -18,7 +18,7 @@ package org.springframework.util.comparator; import java.util.Comparator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/util/comparator/CompoundComparatorTests.java b/spring-core/src/test/java/org/springframework/util/comparator/CompoundComparatorTests.java index 86dc6a41ba5..231dfc0232e 100644 --- a/spring-core/src/test/java/org/springframework/util/comparator/CompoundComparatorTests.java +++ b/spring-core/src/test/java/org/springframework/util/comparator/CompoundComparatorTests.java @@ -18,7 +18,7 @@ package org.springframework.util.comparator; import java.util.Comparator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; diff --git a/spring-core/src/test/java/org/springframework/util/comparator/InstanceComparatorTests.java b/spring-core/src/test/java/org/springframework/util/comparator/InstanceComparatorTests.java index 2efbc25de52..9647025b573 100644 --- a/spring-core/src/test/java/org/springframework/util/comparator/InstanceComparatorTests.java +++ b/spring-core/src/test/java/org/springframework/util/comparator/InstanceComparatorTests.java @@ -18,7 +18,7 @@ package org.springframework.util.comparator; import java.util.Comparator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/comparator/InvertibleComparatorTests.java b/spring-core/src/test/java/org/springframework/util/comparator/InvertibleComparatorTests.java index 2c077c7bc82..0cfcad79e63 100644 --- a/spring-core/src/test/java/org/springframework/util/comparator/InvertibleComparatorTests.java +++ b/spring-core/src/test/java/org/springframework/util/comparator/InvertibleComparatorTests.java @@ -18,7 +18,7 @@ package org.springframework.util.comparator; import java.util.Comparator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/comparator/NullSafeComparatorTests.java b/spring-core/src/test/java/org/springframework/util/comparator/NullSafeComparatorTests.java index c5840bf99fb..ab8aa34a64f 100644 --- a/spring-core/src/test/java/org/springframework/util/comparator/NullSafeComparatorTests.java +++ b/spring-core/src/test/java/org/springframework/util/comparator/NullSafeComparatorTests.java @@ -18,7 +18,7 @@ package org.springframework.util.comparator; import java.util.Comparator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/concurrent/FutureAdapterTests.java b/spring-core/src/test/java/org/springframework/util/concurrent/FutureAdapterTests.java index 187af398621..edb58e0c61c 100644 --- a/spring-core/src/test/java/org/springframework/util/concurrent/FutureAdapterTests.java +++ b/spring-core/src/test/java/org/springframework/util/concurrent/FutureAdapterTests.java @@ -20,8 +20,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.BDDMockito.given; @@ -37,7 +37,7 @@ public class FutureAdapterTests { private Future adaptee; - @Before + @BeforeEach @SuppressWarnings("unchecked") public void setUp() { adaptee = mock(Future.class); diff --git a/spring-core/src/test/java/org/springframework/util/concurrent/ListenableFutureTaskTests.java b/spring-core/src/test/java/org/springframework/util/concurrent/ListenableFutureTaskTests.java index aef4f186a20..036b59cd20a 100644 --- a/spring-core/src/test/java/org/springframework/util/concurrent/ListenableFutureTaskTests.java +++ b/spring-core/src/test/java/org/springframework/util/concurrent/ListenableFutureTaskTests.java @@ -20,7 +20,7 @@ import java.io.IOException; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/util/concurrent/MonoToListenableFutureAdapterTests.java b/spring-core/src/test/java/org/springframework/util/concurrent/MonoToListenableFutureAdapterTests.java index 509d4e49249..b58db02e22f 100644 --- a/spring-core/src/test/java/org/springframework/util/concurrent/MonoToListenableFutureAdapterTests.java +++ b/spring-core/src/test/java/org/springframework/util/concurrent/MonoToListenableFutureAdapterTests.java @@ -19,7 +19,7 @@ import java.time.Duration; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicReference; -import org.junit.Test; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/concurrent/SettableListenableFutureTests.java b/spring-core/src/test/java/org/springframework/util/concurrent/SettableListenableFutureTests.java index 425973ec644..1b789089c06 100644 --- a/spring-core/src/test/java/org/springframework/util/concurrent/SettableListenableFutureTests.java +++ b/spring-core/src/test/java/org/springframework/util/concurrent/SettableListenableFutureTests.java @@ -22,7 +22,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/util/unit/DataSizeTests.java b/spring-core/src/test/java/org/springframework/util/unit/DataSizeTests.java index 65998214147..04cd1546700 100644 --- a/spring-core/src/test/java/org/springframework/util/unit/DataSizeTests.java +++ b/spring-core/src/test/java/org/springframework/util/unit/DataSizeTests.java @@ -16,7 +16,7 @@ package org.springframework.util.unit; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxHandlerTestCase.java b/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxHandlerTestCase.java index 4e5ac983ebc..3c96fa26201 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxHandlerTestCase.java +++ b/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxHandlerTestCase.java @@ -25,8 +25,8 @@ import javax.xml.transform.Result; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.stream.StreamResult; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.xml.sax.InputSource; @@ -61,7 +61,7 @@ public abstract class AbstractStaxHandlerTestCase { private XMLReader xmlReader; - @Before + @BeforeEach @SuppressWarnings("deprecation") // on JDK 9 public void createXMLReader() throws Exception { xmlReader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader(); diff --git a/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxXMLReaderTestCase.java b/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxXMLReaderTestCase.java index 4c2bec5e496..7f9f7994e56 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxXMLReaderTestCase.java +++ b/spring-core/src/test/java/org/springframework/util/xml/AbstractStaxXMLReaderTestCase.java @@ -25,8 +25,8 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.sax.SAXSource; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.w3c.dom.Node; @@ -62,7 +62,7 @@ public abstract class AbstractStaxXMLReaderTestCase { private ContentHandler standardContentHandler; - @Before + @BeforeEach @SuppressWarnings("deprecation") // on JDK 9 public void setUp() throws Exception { inputFactory = XMLInputFactory.newInstance(); diff --git a/spring-core/src/test/java/org/springframework/util/xml/DomContentHandlerTests.java b/spring-core/src/test/java/org/springframework/util/xml/DomContentHandlerTests.java index 8ec0b90e790..eb877331cf6 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/DomContentHandlerTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/DomContentHandlerTests.java @@ -20,8 +20,8 @@ import java.io.StringReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.InputSource; @@ -60,7 +60,7 @@ public class DomContentHandlerTests { private DocumentBuilder documentBuilder; - @Before + @BeforeEach @SuppressWarnings("deprecation") // on JDK 9 public void setUp() throws Exception { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); diff --git a/spring-core/src/test/java/org/springframework/util/xml/ListBasedXMLEventReaderTests.java b/spring-core/src/test/java/org/springframework/util/xml/ListBasedXMLEventReaderTests.java index c4e9b84e27d..e95eb92eaef 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/ListBasedXMLEventReaderTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/ListBasedXMLEventReaderTests.java @@ -27,7 +27,7 @@ import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.events.XMLEvent; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.tests.XmlContent; diff --git a/spring-core/src/test/java/org/springframework/util/xml/SimpleNamespaceContextTests.java b/spring-core/src/test/java/org/springframework/util/xml/SimpleNamespaceContextTests.java index ff6e2afa386..2cb0c2efe05 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/SimpleNamespaceContextTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/SimpleNamespaceContextTests.java @@ -21,7 +21,7 @@ import java.util.LinkedHashSet; import java.util.Set; import javax.xml.XMLConstants; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/spring-core/src/test/java/org/springframework/util/xml/StaxEventXMLReaderTests.java b/spring-core/src/test/java/org/springframework/util/xml/StaxEventXMLReaderTests.java index 106cae62d6a..698e80df1a5 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/StaxEventXMLReaderTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/StaxEventXMLReaderTests.java @@ -22,7 +22,7 @@ import javax.xml.stream.XMLEventReader; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.InputSource; diff --git a/spring-core/src/test/java/org/springframework/util/xml/StaxResultTests.java b/spring-core/src/test/java/org/springframework/util/xml/StaxResultTests.java index 1896199fea4..5d9ca7b074b 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/StaxResultTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/StaxResultTests.java @@ -27,8 +27,8 @@ import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamSource; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.tests.XmlContent; @@ -45,7 +45,7 @@ public class StaxResultTests { private XMLOutputFactory inputFactory; - @Before + @BeforeEach public void setUp() throws Exception { TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformer = transformerFactory.newTransformer(); diff --git a/spring-core/src/test/java/org/springframework/util/xml/StaxSourceTests.java b/spring-core/src/test/java/org/springframework/util/xml/StaxSourceTests.java index c2cc48de8b9..9847b15acaa 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/StaxSourceTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/StaxSourceTests.java @@ -28,8 +28,8 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.stream.StreamResult; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.xml.sax.InputSource; @@ -50,7 +50,7 @@ public class StaxSourceTests { private DocumentBuilder documentBuilder; - @Before + @BeforeEach public void setUp() throws Exception { TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformer = transformerFactory.newTransformer(); diff --git a/spring-core/src/test/java/org/springframework/util/xml/StaxStreamXMLReaderTests.java b/spring-core/src/test/java/org/springframework/util/xml/StaxStreamXMLReaderTests.java index d70c616665c..6d33ae8b4bf 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/StaxStreamXMLReaderTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/StaxStreamXMLReaderTests.java @@ -23,7 +23,7 @@ import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.InputSource; diff --git a/spring-core/src/test/java/org/springframework/util/xml/StaxUtilsTests.java b/spring-core/src/test/java/org/springframework/util/xml/StaxUtilsTests.java index 7fe97af318e..d4306bcc38b 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/StaxUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/StaxUtilsTests.java @@ -33,7 +33,7 @@ import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-core/src/test/java/org/springframework/util/xml/TransformerUtilsTests.java b/spring-core/src/test/java/org/springframework/util/xml/TransformerUtilsTests.java index df39bd1a66e..05c66a86b61 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/TransformerUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/TransformerUtilsTests.java @@ -25,7 +25,7 @@ import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.URIResolver; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; diff --git a/spring-core/src/test/java/org/springframework/util/xml/XMLEventStreamReaderTests.java b/spring-core/src/test/java/org/springframework/util/xml/XMLEventStreamReaderTests.java index 001d11285e6..733fcfa7f80 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/XMLEventStreamReaderTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/XMLEventStreamReaderTests.java @@ -25,8 +25,8 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stream.StreamResult; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.w3c.dom.Node; import org.xmlunit.util.Predicate; @@ -42,7 +42,7 @@ public class XMLEventStreamReaderTests { private XMLEventStreamReader streamReader; - @Before + @BeforeEach public void createStreamReader() throws Exception { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLEventReader eventReader = inputFactory.createXMLEventReader(new StringReader(XML)); diff --git a/spring-core/src/test/java/org/springframework/util/xml/XMLEventStreamWriterTests.java b/spring-core/src/test/java/org/springframework/util/xml/XMLEventStreamWriterTests.java index 4d399e79878..af6a3c27164 100644 --- a/spring-core/src/test/java/org/springframework/util/xml/XMLEventStreamWriterTests.java +++ b/spring-core/src/test/java/org/springframework/util/xml/XMLEventStreamWriterTests.java @@ -21,8 +21,8 @@ import javax.xml.stream.XMLEventFactory; import javax.xml.stream.XMLEventWriter; import javax.xml.stream.XMLOutputFactory; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.w3c.dom.Node; import org.xmlunit.util.Predicate; @@ -39,7 +39,7 @@ public class XMLEventStreamWriterTests { private StringWriter stringWriter; - @Before + @BeforeEach public void createStreamReader() throws Exception { stringWriter = new StringWriter(); XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinDefaultParameterNameDiscovererTests.kt b/spring-core/src/test/kotlin/org/springframework/core/KotlinDefaultParameterNameDiscovererTests.kt index 2d272d90fcf..6ef4f7b71a3 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinDefaultParameterNameDiscovererTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/KotlinDefaultParameterNameDiscovererTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 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. @@ -17,7 +17,7 @@ package org.springframework.core import org.junit.Assert.assertEquals -import org.junit.Test +import org.junit.jupiter.api.Test class KotlinDefaultParameterNameDiscovererTests { diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinGenericTypeResolverTests.kt b/spring-core/src/test/kotlin/org/springframework/core/KotlinGenericTypeResolverTests.kt index de2b5c13859..c562e8ab4f1 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinGenericTypeResolverTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/KotlinGenericTypeResolverTests.kt @@ -17,7 +17,7 @@ package org.springframework.core import org.junit.Assert.assertEquals -import org.junit.Test +import org.junit.jupiter.api.Test import org.springframework.core.GenericTypeResolver.resolveReturnTypeArgument import java.lang.reflect.Method diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinMethodParameterTests.kt b/spring-core/src/test/kotlin/org/springframework/core/KotlinMethodParameterTests.kt index 0b4ae47ad8d..8530afb42e4 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinMethodParameterTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/KotlinMethodParameterTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 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. @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.core import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue -import org.junit.Test +import org.junit.jupiter.api.Test import java.lang.reflect.Method import java.lang.reflect.TypeVariable import kotlin.reflect.full.declaredFunctions diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinReactiveAdapterRegistryTests.kt b/spring-core/src/test/kotlin/org/springframework/core/KotlinReactiveAdapterRegistryTests.kt index be440fabd9b..24352a090cd 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinReactiveAdapterRegistryTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/KotlinReactiveAdapterRegistryTests.kt @@ -27,7 +27,7 @@ import kotlinx.coroutines.runBlocking import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Assert.fail -import org.junit.Test +import org.junit.jupiter.api.Test import org.reactivestreams.Publisher import reactor.core.publisher.Flux import reactor.core.publisher.Mono diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinReflectionParameterNameDiscovererTests.kt b/spring-core/src/test/kotlin/org/springframework/core/KotlinReflectionParameterNameDiscovererTests.kt index d376322120f..a3423775d30 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinReflectionParameterNameDiscovererTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/KotlinReflectionParameterNameDiscovererTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2019 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. @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.core -import org.junit.Test +import org.junit.jupiter.api.Test import org.hamcrest.CoreMatchers.`is` import org.hamcrest.MatcherAssert.assertThat diff --git a/spring-core/src/test/kotlin/org/springframework/core/env/PropertyResolverExtensionsTests.kt b/spring-core/src/test/kotlin/org/springframework/core/env/PropertyResolverExtensionsTests.kt index 96854fe5496..54a867ea186 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/env/PropertyResolverExtensionsTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/env/PropertyResolverExtensionsTests.kt @@ -19,7 +19,7 @@ package org.springframework.core.env import io.mockk.every import io.mockk.mockk import io.mockk.verify -import org.junit.Test +import org.junit.jupiter.api.Test /** * Mock object based tests for PropertyResolver Kotlin extensions.