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
This commit is contained in:
parent
bb8fd1c6bd
commit
32cc32f9a7
|
|
@ -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}")
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Cacheable> cacheables = getAllMergedAnnotations(getBridgeMethod(), Cacheable.class);
|
||||
assertThat(cacheables).isNotNull();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
* <p>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 <em>after</em> 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 <em>after</em>
|
||||
* method.
|
||||
*/
|
||||
public void checkForLeaks() {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue