From 3d1333c1f06a14f44586ab3252ecd945047103aa Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 19 Jun 2020 12:13:56 -0400 Subject: [PATCH] Fix test for the proper reactive template --- .../CassandraOutboundAdapterIntegrationTests.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/config/CassandraOutboundAdapterIntegrationTests.java b/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/config/CassandraOutboundAdapterIntegrationTests.java index 4ba04eb..7ed979b 100644 --- a/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/config/CassandraOutboundAdapterIntegrationTests.java +++ b/spring-integration-cassandra/src/test/java/org/springframework/integration/cassandra/config/CassandraOutboundAdapterIntegrationTests.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.condition.OS; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.cassandra.core.CassandraTemplate; +import org.springframework.data.cassandra.core.ReactiveCassandraTemplate; import org.springframework.data.cassandra.core.WriteResult; import org.springframework.integration.cassandra.test.domain.Book; import org.springframework.integration.cassandra.test.domain.BookSampler; @@ -60,7 +60,7 @@ class CassandraOutboundAdapterIntegrationTests { private static final String CASSANDRA_CONFIG = "spring-cassandra.yaml"; @Autowired - private CassandraTemplate cassandraTemplate; + private ReactiveCassandraTemplate cassandraTemplate; @Autowired private DirectChannel cassandraMessageHandler1; @@ -97,7 +97,7 @@ class CassandraOutboundAdapterIntegrationTests { Message message = MessageBuilder.withPayload(b1).build(); this.cassandraMessageHandler1.send(message); Select select = QueryBuilder.selectFrom("book").all(); - List books = this.cassandraTemplate.select(select.build(), Book.class); + List books = this.cassandraTemplate.select(select.build(), Book.class).collectList().block(); assertThat(books).hasSize(1); this.cassandraTemplate.delete(b1); } @@ -143,7 +143,7 @@ class CassandraOutboundAdapterIntegrationTests { Message>> message = MessageBuilder.withPayload(ingestBooks).build(); this.cassandraMessageHandler3.send(message); Select select = QueryBuilder.selectFrom("book").all(); - books = this.cassandraTemplate.select(select.build(), Book.class); + books = this.cassandraTemplate.select(select.build(), Book.class).collectList().block(); assertThat(books).hasSize(5); this.cassandraTemplate.batchOps().delete(books); } @@ -153,10 +153,10 @@ class CassandraOutboundAdapterIntegrationTests { Message message = MessageBuilder.withPayload(BookSampler.getBook()).build(); this.cassandraMessageHandler1.send(message); Select select = QueryBuilder.selectFrom("book").all(); - List books = this.cassandraTemplate.select(select.build(), Book.class); + List books = this.cassandraTemplate.select(select.build(), Book.class).collectList().block(); assertThat(books).hasSize(1); this.cassandraMessageHandler4.send(MessageBuilder.withPayload("Empty").build()); - books = this.cassandraTemplate.select(select.build(), Book.class); + books = this.cassandraTemplate.select(select.build(), Book.class).collectList().block(); assertThat(books).hasSize(0); }