Fix deprecation warnings

* Use `MatcherAssert.assertThat()`
instead of deprecated `Assert.assertThat()`
* Use `IntegrationFlows.fromSupplier(Supplier)`
instead of removed `IntegrationFlows.from(Supplier)`
* Use `org.springframework.integration:spring-integration-test`
throughout the project for more testing utilities
This commit is contained in:
Artem Bilan
2020-06-29 11:00:32 -04:00
parent cb9f6eb0a5
commit 21e44479ee
87 changed files with 438 additions and 564 deletions

View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId>
<artifactId>async-gateway</artifactId>
<version>5.3.0.RELEASE</version>
<version>5.4.0</version>
<name>Async Gateway Sample</name>
<description>Async Gateway Sample</description>
<url>https://projects.spring.io/spring-integration</url>
@@ -123,8 +123,8 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
@@ -158,14 +158,14 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>5.2.7.RELEASE</version>
<version>5.3.0-M1</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-bom</artifactId>
<version>5.3.1.RELEASE</version>
<version>5.4.0-M1</version>
<scope>import</scope>
<type>pom</type>
</dependency>

View File

@@ -16,8 +16,8 @@
package org.springframework.integration.samples.async.gateway;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.util.Random;
@@ -53,12 +53,12 @@ import reactor.core.scheduler.Schedulers;
* @author Gary Russell
*
*/
@ContextConfiguration(classes = MonoTest.TestConfig.class)
@ContextConfiguration(classes = MonoGatewayTests.TestConfig.class)
@RunWith(SpringJUnit4ClassRunner.class)
@DirtiesContext
public class MonoTest {
public class MonoGatewayTests {
private static Log logger = LogFactory.getLog(MonoTest.class);
private static Log logger = LogFactory.getLog(MonoGatewayTests.class);
@Autowired
private MathGateway gateway;
@@ -79,7 +79,7 @@ public class MonoTest {
for (int i = 0; i < 100; i++) {
final int number = numbers[i];
gateway.multiplyByTwo(number)
.subscribeOn(Schedulers.elastic())
.subscribeOn(Schedulers.boundedElastic())
.filter(p -> p != null)
.doOnNext(result1 -> {
logger.info("Result of multiplication of " + number + " by 2 is " + result1);