Polish "Pulsar template schema detection improvements"

* Adjust AssertJ completable future usage in newly added test.
This commit is contained in:
Chris Bono
2022-08-15 17:46:03 -05:00
parent 624dde15fc
commit 465c5ea3f6

View File

@@ -132,9 +132,8 @@ class PulsarTemplateTests extends AbstractContainerBaseTests {
pulsarTemplate.setSchema(Schema.JSON(Foo.class));
Foo foo = new Foo("Foo-" + UUID.randomUUID(), "Bar-" + UUID.randomUUID());
pulsarTemplate.send(foo);
CompletableFuture<Message<Foo>> receiveMsgFuture = consumer.receiveAsync();
assertThat(receiveMsgFuture).isCompleted().isCompletedWithValueMatching(m -> m.getValue().equals(foo));
assertThat(consumer.receiveAsync()).succeedsWithin(Duration.ofSeconds(3)).extracting(Message::getValue)
.isEqualTo(foo);
}
}
}