File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
spring-rabbit/src/test/java/org/springframework/amqp/rabbit Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -408,15 +408,9 @@ public Object fromMessage(Message message) throws MessageConversionException {
408408
409409 RabbitConverterFuture <String > replyFuture = this .asyncTemplate .convertSendAndReceive ("conversionException" );
410410
411- final CountDownLatch cdl = new CountDownLatch (1 );
412- final AtomicReference <Object > resultRef = new AtomicReference <>();
413- replyFuture .whenComplete ((result , ex ) -> {
414- resultRef .set (result );
415- cdl .countDown ();
416- });
417- assertThat (cdl .await (10 , TimeUnit .SECONDS )).isTrue ();
418- assertThat (replyFuture ).isCompletedExceptionally ();
419- assertThat (resultRef .get ()).isNull ();
411+ assertThat (replyFuture ).failsWithin (Duration .ofSeconds (10 ))
412+ .withThrowableThat ()
413+ .withCauseInstanceOf (MessageConversionException .class );
420414 }
421415
422416 @ Test
You can’t perform that action at this time.
0 commit comments