36
36
*/
37
37
public class NioTlsUnverifiedConnection extends BrokerTestCase {
38
38
39
+ public static final String QUEUE = "tls.nio.queue" ;
40
+
39
41
public void openConnection ()
40
42
throws IOException , TimeoutException {
41
43
try {
@@ -61,10 +63,15 @@ public void openConnection()
61
63
62
64
}
63
65
66
+ @ Override
67
+ protected void releaseResources () throws IOException {
68
+ channel .queueDelete (QUEUE );
69
+ }
70
+
64
71
@ Test
65
72
public void connectionGetConsume () throws Exception {
66
73
CountDownLatch latch = new CountDownLatch (1 );
67
- connection = basicGetBasicConsume (connection , "tls.nio.queue" , latch , 100 * 1000 );
74
+ connection = basicGetBasicConsume (connection , QUEUE , latch , 100 * 1000 );
68
75
boolean messagesReceived = latch .await (5 , TimeUnit .SECONDS );
69
76
assertTrue ("Message has not been received" , messagesReceived );
70
77
}
@@ -113,7 +120,7 @@ public void configure(SSLEngine sslEngine) throws IOException {
113
120
114
121
private void sendAndVerifyMessage (int size ) throws Exception {
115
122
CountDownLatch latch = new CountDownLatch (1 );
116
- connection = basicGetBasicConsume (connection , "tls.nio.queue" , latch , size );
123
+ connection = basicGetBasicConsume (connection , QUEUE , latch , size );
117
124
boolean messagesReceived = latch .await (5 , TimeUnit .SECONDS );
118
125
assertTrue ("Message has not been received" , messagesReceived );
119
126
}
0 commit comments