diff --git a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BinderErrorChannelTests.java b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BinderErrorChannelTests.java index 85c066dba..95fa7b0fd 100644 --- a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BinderErrorChannelTests.java +++ b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BinderErrorChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2019 the original author or authors. + * Copyright 2017-2022 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. @@ -16,8 +16,8 @@ package org.springframework.cloud.stream.binder; -import org.junit.Test; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.springframework.beans.DirectFieldAccessor; import org.springframework.integration.dispatcher.AbstractDispatcher; diff --git a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BindingTargetTests.java b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BindingTargetTests.java index 88bd17a8d..5963c686c 100644 --- a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BindingTargetTests.java +++ b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/BindingTargetTests.java @@ -18,8 +18,8 @@ package org.springframework.cloud.stream.binder; import java.util.function.Function; -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.Mockito; import org.springframework.beans.factory.annotation.Autowired; @@ -28,7 +28,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.PropertySource; import org.springframework.messaging.MessageChannel; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit.jupiter.SpringExtension; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isNull; @@ -40,7 +40,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; * @author Janne Valkealahti * @author Soby Chacko */ -@RunWith(SpringJUnit4ClassRunner.class) +@ExtendWith(SpringExtension.class) @SpringBootTest(classes = BindingTargetTests.TestFooChannels.class, properties = {"spring.cloud.stream.default-binder=mock", "spring.cloud.function.definition=process1;process2"}) public class BindingTargetTests { diff --git a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/DefaultBinderTests.java b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/DefaultBinderTests.java index 9f2fc73f6..9f5cf0a55 100644 --- a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/DefaultBinderTests.java +++ b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/DefaultBinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2020 the original author or authors. + * Copyright 2020-2022 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. @@ -16,7 +16,7 @@ package org.springframework.cloud.stream.binder; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/ErrorBindingTests.java b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/ErrorBindingTests.java index 303ba97e9..9f2b98f75 100644 --- a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/ErrorBindingTests.java +++ b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/ErrorBindingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2018 the original author or authors. + * Copyright 2016-2022 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. @@ -19,7 +19,7 @@ package org.springframework.cloud.stream.binder; import java.util.function.Consumer; import java.util.function.Function; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.springframework.boot.SpringApplication; diff --git a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/ExtendedPropertiesDefaultTests.java b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/ExtendedPropertiesDefaultTests.java index 636e2d06d..966909011 100644 --- a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/ExtendedPropertiesDefaultTests.java +++ b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/ExtendedPropertiesDefaultTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2019 the original author or authors. + * Copyright 2018-2022 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. @@ -19,7 +19,7 @@ package org.springframework.cloud.stream.binder; import java.util.Collections; import java.util.HashMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.cloud.stream.utils.FooConsumerProperties; import org.springframework.cloud.stream.utils.FooProducerProperties; diff --git a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/InputOutputBindingOrderTest.java b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/InputOutputBindingOrderTest.java index 206de3c26..4560bf794 100644 --- a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/InputOutputBindingOrderTest.java +++ b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/InputOutputBindingOrderTest.java @@ -18,7 +18,7 @@ package org.springframework.cloud.stream.binder; import java.util.function.Function; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; diff --git a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/MessageConverterTests.java b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/MessageConverterTests.java index dc4a5c20d..6f73983bc 100644 --- a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/MessageConverterTests.java +++ b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/MessageConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2022 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. @@ -18,7 +18,7 @@ package org.springframework.cloud.stream.binder; import java.nio.BufferUnderflowException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.integration.support.MessageBuilder; import org.springframework.messaging.Message; diff --git a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/PollableConsumerTests.java b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/PollableConsumerTests.java index d1685216f..7bf1591b9 100644 --- a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/PollableConsumerTests.java +++ b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/PollableConsumerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2020 the original author or authors. + * Copyright 2018-2022 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. @@ -23,8 +23,9 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; import org.springframework.boot.WebApplicationType; import org.springframework.boot.builder.SpringApplicationBuilder; @@ -66,13 +67,14 @@ import static org.mockito.Mockito.verify; * @since 2.0 * */ +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class PollableConsumerTests { private ApplicationContext context; private SmartMessageConverter messageConverter; - @Before + @BeforeAll public void before() { this.messageConverter = new CompositeMessageConverterFactory() .getMessageConverterForAllRegistered(); diff --git a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/SinkBindingWithDefaultsTests.java b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/SinkBindingWithDefaultsTests.java index 159cc5c50..bb32ed22a 100644 --- a/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/SinkBindingWithDefaultsTests.java +++ b/core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/SinkBindingWithDefaultsTests.java @@ -18,8 +18,8 @@ package org.springframework.cloud.stream.binder; import java.util.function.Consumer; -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.Mockito; import org.springframework.beans.factory.annotation.Autowired; @@ -27,7 +27,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.messaging.MessageChannel; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit.jupiter.SpringExtension; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isNull; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; * @author Janne Valkealahti * @author Soby Chacko */ -@RunWith(SpringJUnit4ClassRunner.class) +@ExtendWith(SpringExtension.class) @SpringBootTest(classes = SinkBindingWithDefaultsTests.TestSink.class, properties = "spring.cloud.stream.defaultBinder=mock") public class SinkBindingWithDefaultsTests {