-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(FanOutExchangeManager): test binding queues of different types
Test binding queues of different types to the same fanout exchange.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { FanOutExchange } from '../../../../src/lib/exchange/fan-out-exchange'; | ||
import { getFanOutExchangeManager } from '../../../common/fanout-exchange-manager'; | ||
import { getQueueManager } from '../../../common/queue-manager'; | ||
import { FanOutExchangeQueueError } from '../../../../src/lib/exchange/errors/fan-out-exchange-queue.error'; | ||
|
||
test('FanOutExchange: binding different types of queues', async () => { | ||
const fanOutExchangeManager = await getFanOutExchangeManager(); | ||
|
||
const e1 = new FanOutExchange('e1'); | ||
await fanOutExchangeManager.createExchangeAsync(e1); | ||
|
||
const q1 = { ns: 'testing', name: 'w123' }; | ||
const { queue } = await getQueueManager(); | ||
await queue.createAsync(q1, false); | ||
await fanOutExchangeManager.bindQueueAsync(q1, e1); | ||
|
||
const q2 = { ns: 'testing', name: 'w456' }; | ||
await queue.createAsync(q2, true); | ||
|
||
await expect(fanOutExchangeManager.bindQueueAsync(q2, e1)).rejects.toThrow( | ||
FanOutExchangeQueueError, | ||
); | ||
}); |