1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -659,6 +659,7 @@ public void testSendInExternalTransactionWithRollback() throws Exception {
659
659
assertThat (result ).isEqualTo (null );
660
660
}
661
661
662
+ @ SuppressWarnings ("unchecked" )
662
663
@ Test
663
664
public void testAtomicSendAndReceive () throws Exception {
664
665
final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory ();
@@ -689,10 +690,12 @@ public void testAtomicSendAndReceive() throws Exception {
689
690
// Message was consumed so nothing left on queue
690
691
reply = template .receive ();
691
692
assertThat (reply ).isEqualTo (null );
693
+ assertThat (TestUtils .getPropertyValue (template , "replyHolder" , Map .class )).hasSize (0 );
692
694
template .stop ();
693
695
cachingConnectionFactory .destroy ();
694
696
}
695
697
698
+ @ SuppressWarnings ("unchecked" )
696
699
@ Test
697
700
public void testAtomicSendAndReceiveUserCorrelation () throws Exception {
698
701
final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory ();
@@ -732,6 +735,7 @@ public void testAtomicSendAndReceiveUserCorrelation() throws Exception {
732
735
// Message was consumed so nothing left on queue
733
736
reply = template .receive ();
734
737
assertThat (reply ).isEqualTo (null );
738
+ assertThat (TestUtils .getPropertyValue (template , "replyHolder" , Map .class )).hasSize (0 );
735
739
template .stop ();
736
740
container .stop ();
737
741
cachingConnectionFactory .destroy ();
@@ -1330,6 +1334,7 @@ public void testSendAndReceiveNeverFastWitReplyQueue() {
1330
1334
sendAndReceiveFastGuts (true , true , false );
1331
1335
}
1332
1336
1337
+ @ SuppressWarnings ("unchecked" )
1333
1338
private void sendAndReceiveFastGuts (boolean tempQueue , boolean setDirectReplyToExplicitly , boolean expectUsedTemp ) {
1334
1339
RabbitTemplate template = createSendAndReceiveRabbitTemplate (this .connectionFactory );
1335
1340
try {
@@ -1368,6 +1373,7 @@ public Message handleMessage(Message message) {
1368
1373
else {
1369
1374
assertThat (replyToWas .get ()).startsWith (Address .AMQ_RABBITMQ_REPLY_TO );
1370
1375
}
1376
+ assertThat (TestUtils .getPropertyValue (template , "replyHolder" , Map .class )).hasSize (0 );
1371
1377
}
1372
1378
catch (Exception e ) {
1373
1379
assertThat (e .getCause ().getCause ().getMessage ()).contains ("404" );
@@ -1378,6 +1384,7 @@ public Message handleMessage(Message message) {
1378
1384
}
1379
1385
}
1380
1386
1387
+ @ SuppressWarnings ("unchecked" )
1381
1388
@ Test
1382
1389
public void testReplyCompressionWithContainer () {
1383
1390
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer (
@@ -1406,6 +1413,7 @@ public String handleMessage(String message) {
1406
1413
GUnzipPostProcessor unzipper = new GUnzipPostProcessor ();
1407
1414
reply = unzipper .postProcessMessage (reply );
1408
1415
assertThat (new String (reply .getBody ())).isEqualTo ("FOO" );
1416
+ assertThat (TestUtils .getPropertyValue (template , "replyHolder" , Map .class )).hasSize (0 );
1409
1417
}
1410
1418
finally {
1411
1419
template .stop ();
@@ -1420,7 +1428,7 @@ protected RabbitTemplate createSendAndReceiveRabbitTemplate(ConnectionFactory co
1420
1428
}
1421
1429
1422
1430
@ Test
1423
- public void testDegugLogOnPassiveDeclaration () {
1431
+ public void testDebugLogOnPassiveDeclaration () {
1424
1432
CachingConnectionFactory connectionFactory = new CachingConnectionFactory ("localhost" );
1425
1433
Log logger = spy (TestUtils .getPropertyValue (connectionFactory , "logger" , Log .class ));
1426
1434
doReturn (true ).when (logger ).isDebugEnabled ();
0 commit comments