Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit b446418

Browse files
committed
Fix test
1 parent e178e02 commit b446418

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/test/java/reactor/rabbitmq/RabbitFluxTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,12 @@ public void publishConfirmsErrorWhilePublishing() throws Exception {
802802
when(mockChannel.getNextPublishSeqNo()).thenAnswer(invocation -> publishSequence.incrementAndGet());
803803
when(mockChannel.isOpen()).thenReturn(true);
804804

805+
CountDownLatch channelCloseLatch = new CountDownLatch(1);
806+
doAnswer(answer -> {
807+
channelCloseLatch.countDown();
808+
return null;
809+
}).when(mockChannel).close();
810+
805811
CountDownLatch serverPublishConfirmLatch = new CountDownLatch(1);
806812
doNothing()
807813
.doAnswer(answer -> {
@@ -842,6 +848,7 @@ public void publishConfirmsErrorWhilePublishing() throws Exception {
842848
});
843849

844850
assertTrue(confirmLatch.await(1L, TimeUnit.SECONDS));
851+
assertTrue(channelCloseLatch.await(1L, TimeUnit.SECONDS));
845852
verify(mockChannel, times(1)).close();
846853
}
847854

0 commit comments

Comments
 (0)