Skip to content

Commit 91460a6

Browse files
committed
Upgrade deps to latest major/minor
* Fix deprecations for Testcontainers * Remove Jackson 2 from the test scope * Fix reported Jackson 2 usages to Jackson 3-based API * Fix leftover usages of JUnit 4 * Mark `ReactiveStreamsTests.testPollableReactiveFlow()` as `@RetryingTest(10)` * Remove `exclude group: 'org.hamcrest'` from `awaitility` as the one required for `await()` API
1 parent 0bfd478 commit 91460a6

File tree

12 files changed

+81
-104
lines changed

12 files changed

+81
-104
lines changed

build.gradle

Lines changed: 56 additions & 77 deletions
Large diffs are not rendered by default.

spring-integration-amqp/src/test/java/org/springframework/integration/amqp/channel/ChannelTests-context.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<int:queue />
3030
</int:channel>
3131

32-
<bean id="jackson" class="org.springframework.amqp.support.converter.Jackson2JsonMessageConverter" />
32+
<bean id="jackson" class="org.springframework.amqp.support.converter.JacksonJsonMessageConverter" />
3333

3434
<bean id="mapperIn" class="org.springframework.integration.amqp.support.DefaultAmqpHeaderMapper"
3535
factory-method="inboundMapper" />

spring-integration-amqp/src/test/java/org/springframework/integration/amqp/outbound/AmqpOutboundEndpointTests-context.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
<property name="delegates">
105105
<map>
106106
<entry key="application/json">
107-
<bean class="org.springframework.amqp.support.converter.Jackson2JsonMessageConverter" />
107+
<bean class="org.springframework.amqp.support.converter.JacksonJsonMessageConverter" />
108108
</entry>
109109
</map>
110110
</property>

spring-integration-amqp/src/test/java/org/springframework/integration/amqp/support/RabbitTestContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
import java.time.Duration;
2121

2222
import org.junit.jupiter.api.BeforeAll;
23-
import org.testcontainers.containers.RabbitMQContainer;
2423
import org.testcontainers.junit.jupiter.Testcontainers;
24+
import org.testcontainers.rabbitmq.RabbitMQContainer;
2525

2626
/**
2727
* Provides a static {@link RabbitMQContainer} that can be shared across test classes.

spring-integration-core/src/test/java/org/springframework/integration/dsl/reactivestreams/ReactiveStreamsTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.stream.Collectors;
3131

3232
import org.junit.jupiter.api.Test;
33+
import org.junitpioneer.jupiter.RetryingTest;
3334
import org.reactivestreams.Publisher;
3435
import reactor.core.Disposable;
3536
import reactor.core.publisher.Flux;
@@ -128,7 +129,7 @@ void testReactiveFlow() throws Exception {
128129
assertThat(TestUtils.getPropertyValue(this.messageSource, "messagingTemplate.sendTimeout")).isEqualTo(256L);
129130
}
130131

131-
@Test
132+
@RetryingTest(10)
132133
void testPollableReactiveFlow() throws Exception {
133134
assertThat(this.reactiveTransformer).isInstanceOf(ReactiveStreamsConsumer.class);
134135
this.reactiveTransformer.setTaskScheduler(new SimpleAsyncTaskScheduler());

spring-integration-debezium/src/test/java/org/springframework/integration/debezium/DebeziumMySqlTestContainer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import java.util.concurrent.ThreadLocalRandom;
2222

2323
import org.junit.jupiter.api.BeforeAll;
24-
import org.testcontainers.containers.MySQLContainer;
2524
import org.testcontainers.junit.jupiter.Testcontainers;
25+
import org.testcontainers.mysql.MySQLContainer;
2626
import org.testcontainers.utility.DockerImageName;
2727

2828
/**
@@ -36,8 +36,8 @@ public interface DebeziumMySqlTestContainer {
3636

3737
int EXPECTED_DB_TX_COUNT = 52;
3838

39-
MySQLContainer<?> DEBEZIUM_MYSQL =
40-
new MySQLContainer<>(
39+
MySQLContainer DEBEZIUM_MYSQL =
40+
new MySQLContainer(
4141
DockerImageName.parse("debezium/example-mysql:3.0.0.Final")
4242
.asCompatibleSubstituteFor("mysql"))
4343
.withUsername("mysqluser")

spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlContainerTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020

2121
import org.apache.commons.dbcp2.BasicDataSource;
2222
import org.junit.jupiter.api.BeforeAll;
23-
import org.testcontainers.containers.MySQLContainer;
2423
import org.testcontainers.junit.jupiter.Testcontainers;
24+
import org.testcontainers.mysql.MySQLContainer;
2525

2626
/**
27-
* The base contract for JUnit tests based on the container for MqSQL.
28-
* The Testcontainers 'reuse' option must be disabled,so, Ryuk container is started
27+
* The base contract for JUnit-based tests on the container for MqSQL.
28+
* The Testcontainers 'reuse' option must be disabled, so, Ryuk container is started
2929
* and will clean all the containers up from this test suite after JVM exit.
3030
* Since the MqSQL container instance is shared via static property, it is going to be
31-
* started only once per JVM, therefore the target Docker container is reused automatically.
31+
* started only once per JVM; therefore, the target Docker container is reused automatically.
3232
*
3333
* @author Artem Bilan
3434
*
@@ -37,7 +37,7 @@
3737
@Testcontainers(disabledWithoutDocker = true)
3838
public interface MySqlContainerTest {
3939

40-
MySQLContainer<?> MY_SQL_CONTAINER = new MySQLContainer<>("mysql:8.0.29-oracle");
40+
MySQLContainer MY_SQL_CONTAINER = new MySQLContainer("mysql:8.0.29-oracle");
4141

4242
@BeforeAll
4343
static void startContainer() {

spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/postgres/PostgresContainerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020

2121
import org.apache.commons.dbcp2.BasicDataSource;
2222
import org.junit.jupiter.api.BeforeAll;
23-
import org.testcontainers.containers.PostgreSQLContainer;
2423
import org.testcontainers.junit.jupiter.Testcontainers;
24+
import org.testcontainers.postgresql.PostgreSQLContainer;
2525

2626
/**
2727
* The base contract for JUnit tests based on the container for Postgres.
2828
* The Testcontainers 'reuse' option must be disabled, so, Ryuk container is started
2929
* and will clean all the containers up from this test suite after JVM exit.
3030
* Since the Postgres container instance is shared via static property, it is going to be
31-
* started only once per JVM, therefore the target Docker container is reused automatically.
31+
* started only once per JVM; therefore, the target Docker container is reused automatically.
3232
*
3333
* @author Artem Bilan
3434
* @author Rafael Winterhalter
@@ -39,7 +39,7 @@
3939
@Testcontainers(disabledWithoutDocker = true)
4040
public interface PostgresContainerTest {
4141

42-
PostgreSQLContainer<?> POSTGRES_CONTAINER = new PostgreSQLContainer<>("postgres:11")
42+
PostgreSQLContainer POSTGRES_CONTAINER = new PostgreSQLContainer("postgres:11")
4343
.withInitScript("org/springframework/integration/jdbc/schema-postgresql.sql");
4444

4545
@BeforeAll

spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/MongoDbContainerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import org.bson.UuidRepresentation;
2828
import org.bson.conversions.Bson;
2929
import org.junit.jupiter.api.BeforeAll;
30-
import org.testcontainers.containers.MongoDBContainer;
3130
import org.testcontainers.junit.jupiter.Testcontainers;
31+
import org.testcontainers.mongodb.MongoDBContainer;
3232

3333
import org.springframework.dao.DataAccessException;
3434
import org.springframework.data.annotation.Id;
@@ -52,7 +52,7 @@
5252
* The Testcontainers 'reuse' option must be disabled, so, Ryuk container is started
5353
* and will clean all the containers up from this test suite after JVM exit.
5454
* Since the Redis container instance is shared via static property, it is going to be
55-
* started only once per JVM, therefore the target Docker container is reused automatically.
55+
* started only once per JVM; therefore, the target Docker container is reused automatically.
5656
*
5757
* @author Oleg Zhurakousky
5858
* @author Xavier Padro

spring-integration-r2dbc/src/test/java/org/springframework/integration/r2dbc/outbound/R2dbcMessageHandlerTests.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
import java.util.HashMap;
2222
import java.util.List;
2323
import java.util.Map;
24-
import java.util.Optional;
2524

26-
import org.junit.Assert;
2725
import org.junit.jupiter.api.BeforeEach;
2826
import org.junit.jupiter.api.Test;
2927
import reactor.core.publisher.Mono;
@@ -141,7 +139,7 @@ public void validateMessageHandlingWithDefaultUpdateCollection() {
141139

142140
this.personRepository.findAll()
143141
.as(StepVerifier::create)
144-
.consumeNextWith(p -> Assert.assertEquals(Optional.of(40), Optional.ofNullable(p.getAge())))
142+
.consumeNextWith(p -> assertThat(p.getAge()).isEqualTo(40))
145143
.verifyComplete();
146144
}
147145

@@ -181,7 +179,7 @@ public void validateMessageHandlingWithUpdateQueryCollection() {
181179
this.client.sql("SELECT age,name FROM person where age=40")
182180
.fetch().all()
183181
.as(StepVerifier::create)
184-
.consumeNextWith(response -> Assert.assertEquals("{AGE=40, NAME=Bob}", response.toString()))
182+
.consumeNextWith(response -> assertThat(response.toString()).isEqualTo("{AGE=40, NAME=Bob}"))
185183
.verifyComplete();
186184

187185
}

0 commit comments

Comments
 (0)