@@ -88,6 +88,9 @@ public async Task TestRecoverTopologyOnDisposedChannel()
8888 [ Fact ]
8989 public async Task TestTopologyRecoveryQueueFilter ( )
9090 {
91+ string queueToRecover = GenerateQueueName ( ) ;
92+ string queueToIgnore = GenerateQueueName ( ) + "-filtered.queue" ;
93+
9194 var tcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
9295
9396 var filter = new TopologyRecoveryFilter
@@ -103,8 +106,6 @@ public async Task TestTopologyRecoveryQueueFilter()
103106 } ;
104107 IChannel ch = await conn . CreateChannelAsync ( ) ;
105108
106- string queueToRecover = "recovered.queue" ;
107- string queueToIgnore = "filtered.queue" ;
108109 await ch . QueueDeclareAsync ( queueToRecover , false , false , false ) ;
109110 await ch . QueueDeclareAsync ( queueToIgnore , false , false , false ) ;
110111
@@ -138,6 +139,9 @@ public async Task TestTopologyRecoveryQueueFilter()
138139 [ Fact ]
139140 public async Task TestTopologyRecoveryExchangeFilter ( )
140141 {
142+ string exchangeToRecover = GenerateExchangeName ( ) ;
143+ string exchangeToIgnore = GenerateExchangeName ( ) + "-filtered.exchange" ;
144+
141145 var tcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
142146
143147 var filter = new TopologyRecoveryFilter
@@ -154,8 +158,6 @@ public async Task TestTopologyRecoveryExchangeFilter()
154158 IChannel ch = await conn . CreateChannelAsync ( ) ;
155159 try
156160 {
157- string exchangeToRecover = "recovered.exchange" ;
158- string exchangeToIgnore = "filtered.exchange" ;
159161 await ch . ExchangeDeclareAsync ( exchangeToRecover , "topic" , false , true ) ;
160162 await ch . ExchangeDeclareAsync ( exchangeToIgnore , "direct" , false , true ) ;
161163
@@ -186,6 +188,12 @@ public async Task TestTopologyRecoveryExchangeFilter()
186188 [ Fact ]
187189 public async Task TestTopologyRecoveryBindingFilter ( )
188190 {
191+ string exchange = GenerateExchangeName ( ) ;
192+ string queueWithRecoveredBinding = GenerateQueueName ( ) ;
193+ string queueWithIgnoredBinding = GenerateQueueName ( ) ;
194+ const string bindingToRecover = "recovered.binding" ;
195+ const string bindingToIgnore = "filtered.binding" ;
196+
189197 var tcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
190198
191199 var filter = new TopologyRecoveryFilter
@@ -204,12 +212,6 @@ public async Task TestTopologyRecoveryBindingFilter()
204212
205213 try
206214 {
207- string exchange = "topology.recovery.exchange" ;
208- string queueWithRecoveredBinding = "topology.recovery.queue.1" ;
209- string queueWithIgnoredBinding = "topology.recovery.queue.2" ;
210- string bindingToRecover = "recovered.binding" ;
211- string bindingToIgnore = "filtered.binding" ;
212-
213215 await ch . ExchangeDeclareAsync ( exchange , "direct" ) ;
214216 await ch . QueueDeclareAsync ( queueWithRecoveredBinding , false , false , false ) ;
215217 await ch . QueueDeclareAsync ( queueWithIgnoredBinding , false , false , false ) ;
@@ -230,6 +232,9 @@ public async Task TestTopologyRecoveryBindingFilter()
230232 }
231233 finally
232234 {
235+ await ch . ExchangeDeleteAsync ( exchange ) ;
236+ await ch . QueueDeleteAsync ( queueWithRecoveredBinding ) ;
237+ await ch . QueueDeleteAsync ( queueWithIgnoredBinding ) ;
233238 await ch . CloseAsync ( ) ;
234239 await conn . CloseAsync ( ) ;
235240 ch . Dispose ( ) ;
@@ -240,9 +245,9 @@ public async Task TestTopologyRecoveryBindingFilter()
240245 [ Fact ]
241246 public async Task TestTopologyRecoveryDefaultFilterRecoversAllEntities ( )
242247 {
243- const string exchange = "topology.recovery.exchange" ;
244- const string queue1 = "topology.recovery.queue.1" ;
245- const string queue2 = "topology.recovery.queue.2" ;
248+ string exchange = GenerateExchangeName ( ) ;
249+ string queue1 = GenerateQueueName ( ) ;
250+ string queue2 = GenerateQueueName ( ) ;
246251 const string binding1 = "recovered.binding" ;
247252 const string binding2 = "filtered.binding" ;
248253
@@ -329,6 +334,9 @@ public async Task TestTopologyRecoveryDefaultFilterRecoversAllEntities()
329334 [ Fact ]
330335 public async Task TestTopologyRecoveryQueueExceptionHandler ( )
331336 {
337+ string queueToRecoverWithException = GenerateQueueName ( ) + "-recovery.exception.queue" ;
338+ string queueToRecoverSuccessfully = GenerateQueueName ( ) + "-successfully.recovered.queue" ;
339+
332340 var tcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
333341
334342 var changedQueueArguments = new Dictionary < string , object >
@@ -363,8 +371,6 @@ await channel.QueueDeclareAsync(rq.Name, false, false, false,
363371 } ;
364372 IChannel ch = await conn . CreateChannelAsync ( ) ;
365373
366- string queueToRecoverWithException = "recovery.exception.queue" ;
367- string queueToRecoverSuccessfully = "successfully.recovered.queue" ;
368374 await ch . QueueDeclareAsync ( queueToRecoverWithException , false , false , false ) ;
369375 await ch . QueueDeclareAsync ( queueToRecoverSuccessfully , false , false , false ) ;
370376
@@ -395,6 +401,9 @@ await _channel.QueueDeclareAsync(queueToRecoverWithException, false, false, fals
395401 [ Fact ]
396402 public async Task TestTopologyRecoveryExchangeExceptionHandler ( )
397403 {
404+ string exchangeToRecoverWithException = GenerateExchangeName ( ) + "-recovery.exception.exchange" ;
405+ string exchangeToRecoverSuccessfully = GenerateExchangeName ( ) + "-successfully.recovered.exchange" ;
406+
398407 var tcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
399408
400409 var exceptionHandler = new TopologyRecoveryExceptionHandler
@@ -422,8 +431,6 @@ public async Task TestTopologyRecoveryExchangeExceptionHandler()
422431 return Task . CompletedTask ;
423432 } ;
424433
425- string exchangeToRecoverWithException = "recovery.exception.exchange" ;
426- string exchangeToRecoverSuccessfully = "successfully.recovered.exchange" ;
427434 IChannel ch = await conn . CreateChannelAsync ( ) ;
428435 await ch . ExchangeDeclareAsync ( exchangeToRecoverWithException , "direct" , false , false ) ;
429436 await ch . ExchangeDeclareAsync ( exchangeToRecoverSuccessfully , "direct" , false , false ) ;
@@ -455,12 +462,12 @@ public async Task TestTopologyRecoveryExchangeExceptionHandler()
455462 [ Fact ]
456463 public async Task TestTopologyRecoveryBindingExceptionHandler ( )
457464 {
458- var connectionRecoveryTcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
459-
460- const string exchange = "topology.recovery.exchange" ;
461- const string queueWithExceptionBinding = "recovery.exception.queue" ;
465+ string exchange = GenerateExchangeName ( ) ;
466+ string queueWithExceptionBinding = GenerateQueueName ( ) ;
462467 const string bindingToRecoverWithException = "recovery.exception.binding" ;
463468
469+ var connectionRecoveryTcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
470+
464471 var exceptionHandler = new TopologyRecoveryExceptionHandler
465472 {
466473 BindingRecoveryExceptionCondition = ( b , ex ) =>
@@ -520,9 +527,9 @@ public async Task TestTopologyRecoveryBindingExceptionHandler()
520527 [ Fact ]
521528 public async Task TestTopologyRecoveryConsumerExceptionHandler ( )
522529 {
523- var connectionRecoveryTcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
530+ string queueWithExceptionConsumer = GenerateQueueName ( ) + "-recovery.exception.queue" ;
524531
525- string queueWithExceptionConsumer = "recovery.exception.queue" ;
532+ var connectionRecoveryTcs = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
526533
527534 var exceptionHandler = new TopologyRecoveryExceptionHandler
528535 {
0 commit comments