More Redis Streams tests tweaks

This commit is contained in:
Artem Bilan
2020-10-08 11:04:30 -04:00
parent 68379b6fb1
commit dbbd855fb8
2 changed files with 6 additions and 7 deletions

View File

@@ -669,6 +669,7 @@ project('spring-integration-redis') {
}
testImplementation "io.lettuce:lettuce-core:$lettuceVersion"
testImplementation "org.hamcrest:hamcrest-core:$hamcrestVersion"
}
}

View File

@@ -17,6 +17,7 @@
package org.springframework.integration.redis.inbound;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import java.time.Duration;
import java.util.concurrent.atomic.AtomicReference;
@@ -216,14 +217,11 @@ public class ReactiveRedisStreamMessageProducerTests extends RedisAvailableTests
stepVerifier.verify(Duration.ofSeconds(10));
Mono<PendingMessagesSummary> pending =
await().until(() ->
template.opsForStream()
.pending(STREAM_KEY, this.redisStreamMessageProducer.getBeanName());
StepVerifier.create(pending)
.assertNext(pendingMessagesSummary ->
assertThat(pendingMessagesSummary.getTotalPendingMessages()).isEqualTo(1))
.verifyComplete();
.pending(STREAM_KEY, this.redisStreamMessageProducer.getBeanName())
.block(Duration.ofMillis(100))
.getTotalPendingMessages() == 1);
acknowledgmentReference.get().acknowledge();