Support JUnit5 in tests
* wrapper
This commit is contained in:
committed by
Artem Bilan
parent
212f478151
commit
f479270dcd
19
build.gradle
19
build.gradle
@@ -116,7 +116,10 @@ subprojects { subproject ->
|
||||
jrubyVersion = '9.1.5.0'
|
||||
jschVersion = '0.1.54'
|
||||
jsonpathVersion = '2.4.0'
|
||||
junitVersion = '4.12'
|
||||
junit4Version = '4.12'
|
||||
junitJupiterVersion = '5.1.0'
|
||||
junitPlatformVersion = '1.1.0'
|
||||
junitVintageVersion = '5.1.0'
|
||||
jythonVersion = '2.5.3'
|
||||
kryoShadedVersion = '3.0.3'
|
||||
log4jVersion = '2.10.0'
|
||||
@@ -161,6 +164,16 @@ subprojects { subproject ->
|
||||
testCompile project(":spring-integration-test-support")
|
||||
}
|
||||
|
||||
testCompile "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
|
||||
testRuntime "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
|
||||
testRuntime "org.junit.platform:junit-platform-launcher:$junitPlatformVersion"
|
||||
|
||||
// To support JUnit 4 tests
|
||||
testRuntime "org.junit.vintage:junit-vintage-engine:$junitVintageVersion"
|
||||
|
||||
// To avoid compiler warnings about @API annotations in JUnit code
|
||||
testCompileOnly 'org.apiguardian:apiguardian-api:1.0.0'
|
||||
|
||||
testRuntime "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
|
||||
testRuntime "org.apache.logging.log4j:log4j-jcl:$log4jVersion"
|
||||
}
|
||||
@@ -269,7 +282,9 @@ project('spring-integration-test-support') {
|
||||
dependencies {
|
||||
compile "org.hamcrest:hamcrest-core:$hamcrestVersion"
|
||||
compile "org.hamcrest:hamcrest-library:$hamcrestVersion"
|
||||
compile "junit:junit:$junitVersion"
|
||||
compile "junit:junit:$junit4Version"
|
||||
compile ("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion", optional)
|
||||
compileOnly 'org.apiguardian:apiguardian-api:1.0.0'
|
||||
compile "org.mockito:mockito-core:$mockitoVersion"
|
||||
compile "org.assertj:assertj-core:$assertjVersion"
|
||||
compile "org.springframework:spring-context:$springVersion"
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip
|
||||
|
||||
@@ -21,10 +21,8 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.amqp.core.AmqpTemplate;
|
||||
import org.springframework.amqp.core.AnonymousQueue;
|
||||
@@ -35,7 +33,8 @@ import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
|
||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.amqp.rabbit.junit.BrokerRunning;
|
||||
import org.springframework.amqp.rabbit.junit.RabbitAvailable;
|
||||
import org.springframework.amqp.rabbit.junit.RabbitAvailableCondition;
|
||||
import org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer;
|
||||
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -58,7 +57,7 @@ import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.PollableChannel;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
/**
|
||||
* @author Artem Bilan
|
||||
@@ -66,15 +65,12 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
*
|
||||
* @since 5.0
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringJUnitConfig
|
||||
@RabbitAvailable(queues = { "amqpOutboundInput", "amqpReplyChannel", "asyncReplies",
|
||||
"defaultReplyTo", "si.dsl.test", "testTemplateChannelTransacted" })
|
||||
@DirtiesContext
|
||||
public class AmqpTests {
|
||||
|
||||
@ClassRule
|
||||
public static BrokerRunning brokerRunning =
|
||||
BrokerRunning.isRunningWithEmptyQueues("amqpOutboundInput", "amqpReplyChannel", "asyncReplies",
|
||||
"defaultReplyTo", "si.dsl.test", "testTemplateChannelTransacted");
|
||||
|
||||
@Autowired
|
||||
private ConnectionFactory rabbitConnectionFactory;
|
||||
|
||||
@@ -95,9 +91,9 @@ public class AmqpTests {
|
||||
@Autowired
|
||||
private Lifecycle asyncOutboundGateway;
|
||||
|
||||
@AfterClass
|
||||
@AfterAll
|
||||
public static void tearDown() {
|
||||
brokerRunning.removeTestQueues();
|
||||
RabbitAvailableCondition.getBrokerRunning().removeTestQueues();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -24,8 +24,7 @@ import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.ProxyFactoryBean;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
@@ -37,14 +36,14 @@ import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.support.GenericMessage;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
* @since 4.3.10
|
||||
*
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringJUnitConfig
|
||||
@DirtiesContext
|
||||
public class CGLibProxyChannelTests {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user