diff --git a/packages/@azure/servicebus/data-plane/test/batchReceiver.spec.ts b/packages/@azure/servicebus/data-plane/test/batchReceiver.spec.ts index edbad1584a52..a0afe861cd88 100644 --- a/packages/@azure/servicebus/data-plane/test/batchReceiver.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/batchReceiver.spec.ts @@ -106,7 +106,7 @@ async function beforeEachTest( async function afterEachTest(): Promise { await ns.close(); } -describe("Batch Receiver - Complete/Abandon/Defer/Deadletter normal message", function(): void { +describe("Batch Receiver - Settle message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -598,7 +598,7 @@ describe("Batch Receiver - Complete/Abandon/Defer/Deadletter normal message", fu }); }); -describe("Batch Receiver - Abandon/Defer/Deadletter deadlettered message", function(): void { +describe("Batch Receiver - Settle deadlettered message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -1025,7 +1025,7 @@ describe("Batch Receiver - Multiple ReceiveBatch calls", function(): void { }); }); -describe("Batch Receiver - Batching Receiver Misc Tests", function(): void { +describe("Batch Receiver - Others", function(): void { afterEach(async () => { await afterEachTest(); }); diff --git a/packages/@azure/servicebus/data-plane/test/deferredMessage.spec.ts b/packages/@azure/servicebus/data-plane/test/deferredMessage.spec.ts index b14fc0fdaed3..21a5af8355c2 100644 --- a/packages/@azure/servicebus/data-plane/test/deferredMessage.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/deferredMessage.spec.ts @@ -254,12 +254,6 @@ describe("Abandon/Defer/Deadletter deferred message", function(): void { ); await testAbandon(true); }); -}); - -describe("Deferring a deferred message puts it back to the deferred queue.", function(): void { - afterEach(async () => { - await afterEachTest(); - }); async function testDefer(useSessions?: boolean): Promise { const testMessages = useSessions ? testMessagesWithSessions : testSimpleMessages; @@ -343,12 +337,6 @@ describe("Deferring a deferred message puts it back to the deferred queue.", fun ); await testDefer(true); }); -}); - -describe("Deadlettering a deferred message moves it to dead letter queue.", function(): void { - afterEach(async () => { - await afterEachTest(); - }); async function testDeadletter(useSessions?: boolean): Promise { const testMessages = useSessions ? testMessagesWithSessions : testSimpleMessages; diff --git a/packages/@azure/servicebus/data-plane/test/namespace.spec.ts b/packages/@azure/servicebus/data-plane/test/namespace.spec.ts index 7270b26e6a6a..61f3d7997c31 100644 --- a/packages/@azure/servicebus/data-plane/test/namespace.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/namespace.spec.ts @@ -37,7 +37,7 @@ describe("Create Namespace", function(): void { }); }); -describe("Create Queue/Topic/Subscription Clients with no name", function(): void { +describe("Clients with no name", function(): void { let namespace: Namespace; beforeEach(() => { namespace = Namespace.createFromConnectionString( @@ -88,7 +88,7 @@ describe("Create Queue/Topic/Subscription Clients with no name", function(): voi }); }); -describe("Errors when send/receive to/from non existing Namespace", function(): void { +describe("Errors with non existing Namespace", function(): void { let namespace: Namespace; let errorWasThrown: boolean; beforeEach(() => { @@ -198,9 +198,7 @@ describe("Errors when send/receive to/from non existing Namespace", function(): }); }); -describe("Errors when send/receive to/from non existing Queue/Topic/Subscription", async function(): Promise< - void -> { +describe("Errors with non existing Queue/Topic/Subscription", async function(): Promise { let namespace: Namespace; let errorWasThrown: boolean; beforeEach(() => { diff --git a/packages/@azure/servicebus/data-plane/test/receiveAndDeleteMode.spec.ts b/packages/@azure/servicebus/data-plane/test/receiveAndDeleteMode.spec.ts index 68668db91871..2b29cf0daef7 100644 --- a/packages/@azure/servicebus/data-plane/test/receiveAndDeleteMode.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/receiveAndDeleteMode.spec.ts @@ -95,7 +95,7 @@ async function afterEachTest(): Promise { await ns.close(); } -describe("ReceiveBatch from Queue/Subscription", function(): void { +describe("Batch Receiver in ReceiveAndDelete mode", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -191,7 +191,7 @@ describe("ReceiveBatch from Queue/Subscription", function(): void { }); }); -describe("Streaming Receiver from Queue/Subscription", function(): void { +describe("Streaming Receiver in ReceiveAndDelete mode", function(): void { let errorFromErrorHandler: Error | undefined; afterEach(async () => { @@ -391,7 +391,7 @@ describe("Streaming Receiver from Queue/Subscription", function(): void { }); }); -describe("Throws error when Complete/Abandon/Defer/Deadletter/RenewLock of message", function(): void { +describe("Unsupported features in ReceiveAndDelete mode", function(): void { afterEach(async () => { await afterEachTest(); }); diff --git a/packages/@azure/servicebus/data-plane/test/renewLock.spec.ts b/packages/@azure/servicebus/data-plane/test/renewLock.spec.ts index 774cc2ae118e..2632eb9d397f 100644 --- a/packages/@azure/servicebus/data-plane/test/renewLock.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/renewLock.spec.ts @@ -48,7 +48,7 @@ async function afterEachTest(): Promise { await ns.close(); } -describe("Unpartitioned Queue - Lock Renewal Tests", function(): void { +describe("Unpartitioned Queue - Lock Renewal", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.UnpartitionedQueue, ClientType.UnpartitionedQueue); }); @@ -57,25 +57,25 @@ describe("Unpartitioned Queue - Lock Renewal Tests", function(): void { await afterEachTest(); }); - it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise< + it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise< + it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise< void > { await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient); }); - it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise< + it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise< + it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -83,10 +83,9 @@ describe("Unpartitioned Queue - Lock Renewal Tests", function(): void { delayBeforeAttemptingToCompleteMessageInSeconds: 31, willCompleteFail: true }); - // Complete fails as expected }); - it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise< + it("Streaming Receiver: lock will not expire until configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -96,7 +95,7 @@ describe("Unpartitioned Queue - Lock Renewal Tests", function(): void { }); }); - it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise< + it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -106,7 +105,7 @@ describe("Unpartitioned Queue - Lock Renewal Tests", function(): void { }); }).timeout(90000); - it("Receive a msg using Streaming Receiver, lock renewal does not take place when config value is less than lock duration", async function(): Promise< + it("Streaming Receiver: No lock renewal when config value is less than lock duration", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -117,7 +116,7 @@ describe("Unpartitioned Queue - Lock Renewal Tests", function(): void { }); }); -describe("Partitioned Queue - Lock Renewal Tests", function(): void { +describe("Partitioned Queue - Lock Renewal", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.PartitionedQueue, ClientType.PartitionedQueue); }); @@ -126,25 +125,25 @@ describe("Partitioned Queue - Lock Renewal Tests", function(): void { await afterEachTest(); }); - it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise< + it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise< + it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise< void > { await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient); }); - it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise< + it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise< + it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -155,7 +154,7 @@ describe("Partitioned Queue - Lock Renewal Tests", function(): void { // Complete fails as expected }); - it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise< + it("Streaming Receiver: lock will not expire until configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -165,7 +164,7 @@ describe("Partitioned Queue - Lock Renewal Tests", function(): void { }); }); - it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise< + it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -175,7 +174,7 @@ describe("Partitioned Queue - Lock Renewal Tests", function(): void { }); }).timeout(90000); - it("Receive a msg using Streaming Receiver, lock renewal does not take place when config value is less than lock duration", async function(): Promise< + it("Streaming Receiver: No lock renewal when config value is less than lock duration", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -186,7 +185,7 @@ describe("Partitioned Queue - Lock Renewal Tests", function(): void { }); }); -describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void { +describe("Unpartitioned Subscription - Lock Renewal", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.UnpartitionedTopic, ClientType.UnpartitionedSubscription); }); @@ -195,25 +194,25 @@ describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void { await afterEachTest(); }); - it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise< + it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise< + it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise< void > { await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient); }); - it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise< + it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise< + it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -224,7 +223,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void { // Complete fails as expected }); - it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise< + it("Streaming Receiver: lock will not expire until configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -234,7 +233,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void { }); }); - it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise< + it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -244,7 +243,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void { }); }).timeout(90000); - it("Receive a msg using Streaming Receiver, lock renewal does not take place when config value is less than lock duration", async function(): Promise< + it("Streaming Receiver: No lock renewal when config value is less than lock duration", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -255,7 +254,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests", function(): void { }); }); -describe("Partitioned Subscription - Lock Renewal Tests", function(): void { +describe("Partitioned Subscription - Lock Renewal", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.PartitionedTopic, ClientType.PartitionedSubscription); }); @@ -264,25 +263,25 @@ describe("Partitioned Subscription - Lock Renewal Tests", function(): void { await afterEachTest(); }); - it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise< + it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise< + it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise< void > { await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient); }); - it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise< + it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise< + it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -293,7 +292,7 @@ describe("Partitioned Subscription - Lock Renewal Tests", function(): void { // Complete fails as expected }); - it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise< + it("Streaming Receiver: lock will not expire until configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -303,7 +302,7 @@ describe("Partitioned Subscription - Lock Renewal Tests", function(): void { }); }); - it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise< + it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -313,7 +312,7 @@ describe("Partitioned Subscription - Lock Renewal Tests", function(): void { }); }).timeout(90000); - it("Receive a msg using Streaming Receiver, lock renewal does not take place when config value is less than lock duration", async function(): Promise< + it("Streaming Receiver: No lock renewal when config value is less than lock duration", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { diff --git a/packages/@azure/servicebus/data-plane/test/renewLockSessions.spec.ts b/packages/@azure/servicebus/data-plane/test/renewLockSessions.spec.ts index 47de4f048d43..c0d01636a65c 100644 --- a/packages/@azure/servicebus/data-plane/test/renewLockSessions.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/renewLockSessions.spec.ts @@ -53,7 +53,7 @@ async function afterEachTest(): Promise { await ns.close(); } -describe("Unpartitioned Queue - Lock Renewal Tests for Sessions", function(): void { +describe("Unpartitioned Queue - Lock Renewal for Sessions", function(): void { beforeEach(async () => { await beforeEachTest( ClientType.UnpartitionedQueueWithSessions, @@ -65,25 +65,25 @@ describe("Unpartitioned Queue - Lock Renewal Tests for Sessions", function(): vo await afterEachTest(); }); - it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise< + it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise< + it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise< void > { await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient); }); - it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise< + it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise< + it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -93,7 +93,7 @@ describe("Unpartitioned Queue - Lock Renewal Tests for Sessions", function(): vo }); }); - it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise< + it("Streaming Receiver: lock will not expire until configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -103,7 +103,7 @@ describe("Unpartitioned Queue - Lock Renewal Tests for Sessions", function(): vo }); }); - it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise< + it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -124,7 +124,7 @@ describe("Unpartitioned Queue - Lock Renewal Tests for Sessions", function(): vo }); }); -describe("Partitioned Queue - Lock Renewal Tests for Sessions", function(): void { +describe("Partitioned Queue - Lock Renewal for Sessions", function(): void { beforeEach(async () => { await beforeEachTest( ClientType.PartitionedQueueWithSessions, @@ -136,25 +136,25 @@ describe("Partitioned Queue - Lock Renewal Tests for Sessions", function(): void await afterEachTest(); }); - it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise< + it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise< + it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise< void > { await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient); }); - it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise< + it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise< + it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -164,7 +164,7 @@ describe("Partitioned Queue - Lock Renewal Tests for Sessions", function(): void }); }); - it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise< + it("Streaming Receiver: lock will not expire until configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -174,7 +174,7 @@ describe("Partitioned Queue - Lock Renewal Tests for Sessions", function(): void }); }); - it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise< + it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -195,7 +195,7 @@ describe("Partitioned Queue - Lock Renewal Tests for Sessions", function(): void }); }); -describe("Unpartitioned Subscription - Lock Renewal Tests for Sessions", function(): void { +describe("Unpartitioned Subscription - Lock Renewal for Sessions", function(): void { beforeEach(async () => { await beforeEachTest( ClientType.UnpartitionedTopicWithSessions, @@ -207,25 +207,25 @@ describe("Unpartitioned Subscription - Lock Renewal Tests for Sessions", functio await afterEachTest(); }); - it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise< + it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise< + it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise< void > { await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient); }); - it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise< + it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise< + it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -235,7 +235,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests for Sessions", functio }); }); - it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise< + it("Streaming Receiver: lock will not expire until configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -245,7 +245,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests for Sessions", functio }); }); - it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise< + it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -266,7 +266,7 @@ describe("Unpartitioned Subscription - Lock Renewal Tests for Sessions", functio }); }); -describe("Partitioned Subscription - Lock Renewal Tests for Sessions", function(): void { +describe("Partitioned Subscription - Lock Renewal for Sessions", function(): void { beforeEach(async () => { await beforeEachTest( ClientType.PartitionedTopicWithSessions, @@ -278,25 +278,25 @@ describe("Partitioned Subscription - Lock Renewal Tests for Sessions", function( await afterEachTest(); }); - it(`renewLock() with Batch Receiver resets lock duration each time.`, async function(): Promise< + it("Batch Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testBatchReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it(`Receive a msg using Batch Receiver, wait until its lock expires, completing it now results in error`, async function(): Promise< + it("Batch Receiver: complete() after lock expiry with throws error", async function(): Promise< void > { await testBatchReceiverManualLockRenewalErrorOnLockExpiry(senderClient, receiverClient); }); - it("Receives a message using Streaming Receiver renewLock() resets lock duration each time.", async function(): Promise< + it("Streaming Receiver: renewLock() resets lock duration each time.", async function(): Promise< void > { await testStreamingReceiverManualLockRenewalHappyCase(senderClient, receiverClient); }); - it("Receive a msg using Streaming Receiver, lock expires after 30 sec when auto renewal is disabled", async function(): Promise< + it("Streaming Receiver: complete() after lock expiry with auto-renewal disabled throws error", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -306,7 +306,7 @@ describe("Partitioned Subscription - Lock Renewal Tests for Sessions", function( }); }); - it("Receive a msg using Streaming Receiver, lock will not expire until configured time", async function(): Promise< + it("Streaming Receiver: lock will not expire until configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { @@ -316,7 +316,7 @@ describe("Partitioned Subscription - Lock Renewal Tests for Sessions", function( }); }); - it("Receive a msg using Streaming Receiver, lock will expire sometime after the configured time", async function(): Promise< + it("Streaming Receiver: lock expires sometime after configured time", async function(): Promise< void > { await testAutoLockRenewalConfigBehavior(senderClient, receiverClient, { diff --git a/packages/@azure/servicebus/data-plane/test/sendSchedule.spec.ts b/packages/@azure/servicebus/data-plane/test/sendSchedule.spec.ts index fef92954312a..1bb727a8c6d2 100644 --- a/packages/@azure/servicebus/data-plane/test/sendSchedule.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/sendSchedule.spec.ts @@ -81,7 +81,7 @@ async function afterEachTest(): Promise { await ns.close(); } -describe("Send to Queue/Subscription", function(): void { +describe("Simple Send", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -102,27 +102,27 @@ describe("Send to Queue/Subscription", function(): void { await testPeekMsgsLength(receiverClient, 0); } - it("Simple send using Partitioned Queue", async function(): Promise { + it("Partitioned Queue: Simple Send", async function(): Promise { await beforeEachTest(ClientType.PartitionedQueue, ClientType.PartitionedQueue); await testSimpleSend(); }); - it("Simple send using Partitioned Topic", async function(): Promise { + it("Partitioned Topic: Simple Send", async function(): Promise { await beforeEachTest(ClientType.PartitionedTopic, ClientType.PartitionedSubscription); await testSimpleSend(); }); - it("Simple send using Unpartitioned Queue", async function(): Promise { + it("Unpartitioned Queue: Simple Send", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedQueue, ClientType.UnpartitionedQueue); await testSimpleSend(); }); - it("Simple send using Unpartitioned Topic", async function(): Promise { + it("Unpartitioned Topic: Simple Send", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedTopic, ClientType.UnpartitionedSubscription); await testSimpleSend(); }); - it("Simple send using Partitioned Queue with Sessions", async function(): Promise { + it("Partitioned Queue with Sessions: Simple Send", async function(): Promise { await beforeEachTest( ClientType.PartitionedQueueWithSessions, ClientType.PartitionedQueueWithSessions, @@ -131,7 +131,7 @@ describe("Send to Queue/Subscription", function(): void { await testSimpleSend(true); }); - it("Simple send using Partitioned Topic with Sessions", async function(): Promise { + it("Partitioned Topic with Sessions: Simple Send", async function(): Promise { await beforeEachTest( ClientType.PartitionedTopicWithSessions, ClientType.PartitionedSubscriptionWithSessions, @@ -140,7 +140,7 @@ describe("Send to Queue/Subscription", function(): void { await testSimpleSend(true); }); - it("Simple send using Unpartitioned Queue with Sessions", async function(): Promise { + it("Unpartitioned Queue with Sessions: Simple Send", async function(): Promise { await beforeEachTest( ClientType.UnpartitionedQueueWithSessions, ClientType.UnpartitionedQueueWithSessions, @@ -149,7 +149,7 @@ describe("Send to Queue/Subscription", function(): void { await testSimpleSend(true); }); - it("Simple send using Unpartitioned Topic with Sessions", async function(): Promise { + it("Unpartitioned Topic with Sessions: Simple Send", async function(): Promise { await beforeEachTest( ClientType.UnpartitionedTopicWithSessions, ClientType.UnpartitionedSubscriptionWithSessions, @@ -159,7 +159,7 @@ describe("Send to Queue/Subscription", function(): void { }); }); -describe("Schedule a single message to Queue/Subscription", function(): void { +describe("Schedule single message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -187,29 +187,27 @@ describe("Schedule a single message to Queue/Subscription", function(): void { await testPeekMsgsLength(receiverClient, 0); } - it("Schedule single message using Partitioned Queue", async function(): Promise { + it("Partitioned Queue: Schedule single message", async function(): Promise { await beforeEachTest(ClientType.PartitionedQueue, ClientType.PartitionedQueue); await testScheduleMessage(); }); - it("Schedule single message using Partitioned Topic", async function(): Promise { + it("Partitioned Topic: Schedule single message", async function(): Promise { await beforeEachTest(ClientType.PartitionedTopic, ClientType.PartitionedSubscription); await testScheduleMessage(); }); - it("Schedule single message using Unpartitioned Queue", async function(): Promise { + it("Unpartitioned Queue: Schedule single message", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedQueue, ClientType.UnpartitionedQueue); await testScheduleMessage(); }); - it("Schedule single message using Unpartitioned Topic", async function(): Promise { + it("Unpartitioned Topic: Schedule single message", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedTopic, ClientType.UnpartitionedSubscription); await testScheduleMessage(); }); - it("Schedule single message using Partitioned Queue with Sessions", async function(): Promise< - void - > { + it("Partitioned Queue with Sessions: Schedule single message", async function(): Promise { await beforeEachTest( ClientType.PartitionedQueueWithSessions, ClientType.PartitionedQueueWithSessions, @@ -218,9 +216,7 @@ describe("Schedule a single message to Queue/Subscription", function(): void { await testScheduleMessage(true); }); - it("Schedule single message using Partitioned Topic with Sessions", async function(): Promise< - void - > { + it("Partitioned Topic with Sessions: Schedule single message", async function(): Promise { await beforeEachTest( ClientType.PartitionedTopicWithSessions, ClientType.PartitionedSubscriptionWithSessions, @@ -229,9 +225,7 @@ describe("Schedule a single message to Queue/Subscription", function(): void { await testScheduleMessage(true); }); - it("Schedule single message using Unpartitioned Queue with Sessions", async function(): Promise< - void - > { + it("Unpartitioned Queue with Sessions: Schedule single message", async function(): Promise { await beforeEachTest( ClientType.UnpartitionedQueueWithSessions, ClientType.UnpartitionedQueueWithSessions, @@ -240,9 +234,7 @@ describe("Schedule a single message to Queue/Subscription", function(): void { await testScheduleMessage(true); }); - it("Schedule single message using Unpartitioned Topic with Sessions", async function(): Promise< - void - > { + it("Unpartitioned Topic with Sessions: Schedule single message", async function(): Promise { await beforeEachTest( ClientType.UnpartitionedTopicWithSessions, ClientType.UnpartitionedSubscriptionWithSessions, @@ -252,7 +244,7 @@ describe("Schedule a single message to Queue/Subscription", function(): void { }); }); -describe("Schedule multiple messages to Queue/Subscription", function(): void { +describe("Schedule multiple messages", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -322,27 +314,29 @@ describe("Schedule multiple messages to Queue/Subscription", function(): void { await testPeekMsgsLength(receiverClient, 0); } - it("Schedule messages using Queue", async function(): Promise { + it("Partitioned Queue: Schedule multiple messages", async function(): Promise { await beforeEachTest(ClientType.PartitionedQueue, ClientType.PartitionedQueue); await testScheduleMessages(); }); - it("Schedule messages using Topic", async function(): Promise { + it("Partitioned Topic: Schedule multiple messages", async function(): Promise { await beforeEachTest(ClientType.PartitionedTopic, ClientType.PartitionedSubscription); await testScheduleMessages(); }); - it("Schedule messages using UnPartitioned Queue", async function(): Promise { + it("UnPartitioned Queue: Schedule multiple messages", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedQueue, ClientType.UnpartitionedQueue); await testScheduleMessages(); }); - it("Schedule messages using UnPartitioned Topic", async function(): Promise { + it("UnPartitioned Topic: Schedule multiple messages", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedTopic, ClientType.UnpartitionedSubscription); await testScheduleMessages(); }); - it("Schedule messages using Partitioned Queue with Sessions", async function(): Promise { + it("Partitioned Queue with Sessions: Schedule multiple messages", async function(): Promise< + void + > { await beforeEachTest( ClientType.PartitionedQueueWithSessions, ClientType.PartitionedQueueWithSessions, @@ -351,7 +345,9 @@ describe("Schedule multiple messages to Queue/Subscription", function(): void { await testScheduleMessages(true); }); - it("Schedule messages using Partitioned Topic with Sessions", async function(): Promise { + it("Partitioned Topic with Sessions: Schedule multiple messages", async function(): Promise< + void + > { await beforeEachTest( ClientType.PartitionedTopicWithSessions, ClientType.PartitionedSubscriptionWithSessions, @@ -360,7 +356,9 @@ describe("Schedule multiple messages to Queue/Subscription", function(): void { await testScheduleMessages(true); }); - it("Schedule messages using Unpartitioned Queue with Sessions", async function(): Promise { + it("Unpartitioned Queue with Sessions: Schedule multiple messages", async function(): Promise< + void + > { await beforeEachTest( ClientType.UnpartitionedQueueWithSessions, ClientType.UnpartitionedQueueWithSessions, @@ -369,7 +367,9 @@ describe("Schedule multiple messages to Queue/Subscription", function(): void { await testScheduleMessages(true); }); - it("Schedule messages using Unpartitioned Topic with Sessions", async function(): Promise { + it("Unpartitioned Topic with Sessions: Schedule multiple messages", async function(): Promise< + void + > { await beforeEachTest( ClientType.UnpartitionedTopicWithSessions, ClientType.UnpartitionedSubscriptionWithSessions, @@ -379,7 +379,7 @@ describe("Schedule multiple messages to Queue/Subscription", function(): void { }); }); -describe("Cancel a single Scheduled message for sending to Queue/Subscription", function(): void { +describe("Cancel single Scheduled message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -400,31 +400,27 @@ describe("Cancel a single Scheduled message for sending to Queue/Subscription", await testPeekMsgsLength(receiverClient, 0); } - it("Cancel a single Scheduled message using Partitioned Queue", async function(): Promise { + it("Partitioned Queue: Cancel single Scheduled message", async function(): Promise { await beforeEachTest(ClientType.PartitionedQueue, ClientType.PartitionedQueue); await testCancelScheduleMessage(); }); - it("Cancel a single Scheduled message using Partitioned Topic", async function(): Promise { + it("Partitioned Topic: Cancel single Scheduled message", async function(): Promise { await beforeEachTest(ClientType.PartitionedTopic, ClientType.PartitionedSubscription); await testCancelScheduleMessage(); }); - it("Cancel a single Scheduled message using Unpartitioned Queue", async function(): Promise< - void - > { + it("Unpartitioned Queue: Cancel single Scheduled message", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedQueue, ClientType.UnpartitionedQueue); await testCancelScheduleMessage(); }); - it("Cancel a single Scheduled message using Unpartitioned Topic", async function(): Promise< - void - > { + it("Unpartitioned Topic: Cancel single Scheduled message", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedTopic, ClientType.UnpartitionedSubscription); await testCancelScheduleMessage(); }); - it("Cancel a single Scheduled message using Partitioned Queue with Sessions", async function(): Promise< + it("Partitioned Queue with Sessions: Cancel single Scheduled message", async function(): Promise< void > { await beforeEachTest( @@ -435,7 +431,7 @@ describe("Cancel a single Scheduled message for sending to Queue/Subscription", await testCancelScheduleMessage(true); }); - it("Cancel a single Scheduled message using Partitioned Topic with Sessions", async function(): Promise< + it("Partitioned Topic with Sessions: Cancel single Scheduled message", async function(): Promise< void > { await beforeEachTest( @@ -446,7 +442,7 @@ describe("Cancel a single Scheduled message for sending to Queue/Subscription", await testCancelScheduleMessage(true); }); - it("Cancel a single Scheduled message using Unpartitioned Queue with Sessions", async function(): Promise< + it("Unpartitioned Queue with Sessions: Cancel single Scheduled message", async function(): Promise< void > { await beforeEachTest( @@ -457,7 +453,7 @@ describe("Cancel a single Scheduled message for sending to Queue/Subscription", await testCancelScheduleMessage(true); }); - it("Cancel a single Scheduled message using Unpartitioned Topic with Sessions", async function(): Promise< + it("Unpartitioned Topic with Sessions: Cancel single Scheduled message", async function(): Promise< void > { await beforeEachTest( @@ -469,7 +465,7 @@ describe("Cancel a single Scheduled message for sending to Queue/Subscription", }); }); -describe("Cancel multiple Scheduled messages for sending to Queue/Subscription", function(): void { +describe("Cancel multiple Scheduled messages", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -496,29 +492,27 @@ describe("Cancel multiple Scheduled messages for sending to Queue/Subscription", await testPeekMsgsLength(receiverClient, 0); } - it("Cancel Scheduled messages using Partitioned Queue", async function(): Promise { + it("Partitioned Queue: Cancel scheduled messages", async function(): Promise { await beforeEachTest(ClientType.PartitionedQueue, ClientType.PartitionedQueue); await testCancelScheduleMessages(true, false); }); - it("Cancel Scheduled messages using Partitioned Topic", async function(): Promise { + it("Partitioned Topic: Cancel scheduled messages", async function(): Promise { await beforeEachTest(ClientType.PartitionedTopic, ClientType.PartitionedSubscription); await testCancelScheduleMessages(true, false); }); - it("Cancel Scheduled messages using Unpartitioned Queue", async function(): Promise { + it("Unpartitioned Queue: Cancel scheduled messages", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedQueue, ClientType.UnpartitionedQueue); await testCancelScheduleMessages(false, false); }); - it("Cancel Scheduled messages using Unpartitioned Topic", async function(): Promise { + it("Unpartitioned Topic: Cancel scheduled messages", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedTopic, ClientType.UnpartitionedSubscription); await testCancelScheduleMessages(false, false); }); - it("Cancel Scheduled messages using Partitioned Queue with Sessions", async function(): Promise< - void - > { + it("Partitioned Queue with Sessions: Cancel scheduled messages", async function(): Promise { await beforeEachTest( ClientType.PartitionedQueueWithSessions, ClientType.PartitionedQueueWithSessions, @@ -527,9 +521,7 @@ describe("Cancel multiple Scheduled messages for sending to Queue/Subscription", await testCancelScheduleMessages(true, true); }); - it("Cancel Scheduled messages using Partitioned Topic with Sessions", async function(): Promise< - void - > { + it("Partitioned Topic with Sessions: Cancel scheduled messages", async function(): Promise { await beforeEachTest( ClientType.PartitionedTopicWithSessions, ClientType.PartitionedSubscriptionWithSessions, @@ -538,7 +530,7 @@ describe("Cancel multiple Scheduled messages for sending to Queue/Subscription", await testCancelScheduleMessages(true, true); }); - it("Cancel Scheduled messages using Unpartitioned Queue with Sessions", async function(): Promise< + it("Unpartitioned Queue with Sessions: Cancel scheduled messages", async function(): Promise< void > { await beforeEachTest( @@ -549,7 +541,7 @@ describe("Cancel multiple Scheduled messages for sending to Queue/Subscription", await testCancelScheduleMessages(true, true); }); - it("Cancel Scheduled messages using Unpartitioned Topic with Sessions", async function(): Promise< + it("Unpartitioned Topic with Sessions: Cancel scheduled messages", async function(): Promise< void > { await beforeEachTest( diff --git a/packages/@azure/servicebus/data-plane/test/sessionsTests.spec.ts b/packages/@azure/servicebus/data-plane/test/sessionsTests.spec.ts index 0575b3cf9f3c..81b900e01ebf 100644 --- a/packages/@azure/servicebus/data-plane/test/sessionsTests.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/sessionsTests.spec.ts @@ -94,7 +94,7 @@ async function afterEachTest(): Promise { await ns.close(); } -describe("SessionTests - Accept a session by passing non-existing sessionId receives no messages", function(): void { +describe("SessionReceiver with invalid sessionId", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -127,7 +127,7 @@ describe("SessionTests - Accept a session by passing non-existing sessionId rece await testPeekMsgsLength(receiverClient, 0); } - it("Partitioned Queue with Sessions - Batch Receiver: no messages received", async function(): Promise< + it("Partitioned Queue - Batch Receiver: no messages received for invalid sessionId", async function(): Promise< void > { await beforeEachTest( @@ -137,7 +137,7 @@ describe("SessionTests - Accept a session by passing non-existing sessionId rece await test_batching(); }); - it("Partitioned Subscription with Sessions - Batch Receiver: no messages received", async function(): Promise< + it("Partitioned Subscription - Batch Receiver: no messages received for invalid sessionId", async function(): Promise< void > { await beforeEachTest( @@ -147,7 +147,7 @@ describe("SessionTests - Accept a session by passing non-existing sessionId rece await test_batching(); }); - it("Unpartitioned Queue with Sessions - Batch Receiver: no messages received", async function(): Promise< + it("Unpartitioned Queue - Batch Receiver: no messages received for invalid sessionId", async function(): Promise< void > { await beforeEachTest( @@ -157,7 +157,7 @@ describe("SessionTests - Accept a session by passing non-existing sessionId rece await test_batching(); }); - it("Unpartitioned Subscription with Sessions - Batch Receiver: no messages received", async function(): Promise< + it("Unpartitioned Subscription - Batch Receiver: no messages received for invalid sessionId", async function(): Promise< void > { await beforeEachTest( @@ -208,7 +208,7 @@ describe("SessionTests - Accept a session by passing non-existing sessionId rece await testPeekMsgsLength(receiverClient, 0); } - it("Partitioned Queue with Sessions - Streaming Receiver: no messages received", async function(): Promise< + it("Partitioned Queue - Streaming Receiver: no messages received for invalid sessionId", async function(): Promise< void > { await beforeEachTest( @@ -218,7 +218,7 @@ describe("SessionTests - Accept a session by passing non-existing sessionId rece await test_streaming(); }); - it("Partitioned Subscription with Sessions - Streaming Receiver: no messages received", async function(): Promise< + it("Partitioned Subscription - Streaming Receiver: no messages received for invalid sessionId", async function(): Promise< void > { await beforeEachTest( @@ -228,7 +228,7 @@ describe("SessionTests - Accept a session by passing non-existing sessionId rece await test_streaming(); }); - it("Unpartitioned Queue with Sessions - Streaming Receiver: no messages received", async function(): Promise< + it("Unpartitioned Queue - Streaming Receiver: no messages received for invalid sessionId", async function(): Promise< void > { await beforeEachTest( @@ -238,7 +238,7 @@ describe("SessionTests - Accept a session by passing non-existing sessionId rece await test_streaming(); }); - it("Unpartitioned Subscription with Sessions - Streaming Receiver: no messages received", async function(): Promise< + it("Unpartitioned Subscription - Streaming Receiver: no messages received for invalid sessionId", async function(): Promise< void > { await beforeEachTest( @@ -249,7 +249,7 @@ describe("SessionTests - Accept a session by passing non-existing sessionId rece }); }); -describe("SessionTests - Accept a session without passing sessionId and receive messages from randomly selected sessionId", function(): void { +describe("SessionReceiver with no sessionId", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -297,7 +297,7 @@ describe("SessionTests - Accept a session without passing sessionId and receive await testPeekMsgsLength(receiverClient, 0); } - it("Partitioned Queue with Sessions - Batch Receiver: complete() removes message", async function(): Promise< + it("Partitioned Queue: complete() removes message from random session", async function(): Promise< void > { await beforeEachTest( @@ -308,7 +308,7 @@ describe("SessionTests - Accept a session without passing sessionId and receive await testComplete_batching(); }); - it("Partitioned Subscription with Sessions - Batch Receiver: complete() removes message", async function(): Promise< + it("Partitioned Subscription: complete() removes message from random session", async function(): Promise< void > { await beforeEachTest( @@ -319,7 +319,7 @@ describe("SessionTests - Accept a session without passing sessionId and receive await testComplete_batching(); }); - it("Unpartitioned Queue with Sessions - Batch Receiver: complete() removes message", async function(): Promise< + it("Unpartitioned Queue: complete() removes message from random session", async function(): Promise< void > { await beforeEachTest( @@ -330,7 +330,7 @@ describe("SessionTests - Accept a session without passing sessionId and receive await testComplete_batching(); }); - it("Unpartitioned Subscription with Sessions - Batch Receiver: complete() removes message", async function(): Promise< + it("Unpartitioned Subscription: complete() removes message from random session", async function(): Promise< void > { await beforeEachTest( @@ -342,7 +342,7 @@ describe("SessionTests - Accept a session without passing sessionId and receive }); }); -describe("SessionTests - getState and setState in Session enabled Queues/Subscriptions", function(): void { +describe("Session State", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -395,9 +395,7 @@ describe("SessionTests - getState and setState in Session enabled Queues/Subscri await msgs[0].complete(); await testPeekMsgsLength(receiverClient, 0); } - it("Partitioned Queue with Sessions - Testing getState and setState", async function(): Promise< - void - > { + it("Partitioned Queue - Testing getState and setState", async function(): Promise { await beforeEachTest( ClientType.PartitionedQueueWithSessions, ClientType.PartitionedQueueWithSessions @@ -405,9 +403,7 @@ describe("SessionTests - getState and setState in Session enabled Queues/Subscri await purge(receiverClient, testSessionId2); await testGetSetState(); }); - it("Partitioned Subscription with Sessions - Testing getState and setState", async function(): Promise< - void - > { + it("Partitioned Subscription - Testing getState and setState", async function(): Promise { await beforeEachTest( ClientType.PartitionedTopicWithSessions, ClientType.PartitionedSubscriptionWithSessions @@ -415,9 +411,7 @@ describe("SessionTests - getState and setState in Session enabled Queues/Subscri await purge(receiverClient, testSessionId2); await testGetSetState(); }); - it("Unpartitioned Queue with Sessions - Testing getState and setState", async function(): Promise< - void - > { + it("Unpartitioned Queue - Testing getState and setState", async function(): Promise { await beforeEachTest( ClientType.UnpartitionedQueueWithSessions, ClientType.UnpartitionedQueueWithSessions @@ -425,9 +419,7 @@ describe("SessionTests - getState and setState in Session enabled Queues/Subscri await purge(receiverClient, testSessionId2); await testGetSetState(); }); - it("Unpartitioned Subscription with Sessions - Testing getState and setState", async function(): Promise< - void - > { + it("Unpartitioned Subscription - Testing getState and setState", async function(): Promise { await beforeEachTest( ClientType.UnpartitionedTopicWithSessions, ClientType.UnpartitionedSubscriptionWithSessions @@ -437,7 +429,7 @@ describe("SessionTests - getState and setState in Session enabled Queues/Subscri }); }); -describe("SessionTests - Second Session Receiver for same session id", function(): void { +describe("Second SessionReceiver for same sessionId", function(): void { afterEach(async () => { await afterEachTest(); }); diff --git a/packages/@azure/servicebus/data-plane/test/streamingReceiver.spec.ts b/packages/@azure/servicebus/data-plane/test/streamingReceiver.spec.ts index ad04b1f00b6f..28aa103dccf1 100644 --- a/packages/@azure/servicebus/data-plane/test/streamingReceiver.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/streamingReceiver.spec.ts @@ -108,7 +108,7 @@ async function afterEachTest(): Promise { await ns.close(); } -describe("Streaming Receiver - Misc Tests", function(): void { +describe("Streaming - Misc Tests", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -139,24 +139,22 @@ describe("Streaming Receiver - Misc Tests", function(): void { await testPeekMsgsLength(receiverClient, 0); } - it("AutoComplete removes the message from Partitioned Queue", async function(): Promise { + it("Partitioned Queue: AutoComplete removes the message", async function(): Promise { await beforeEachTest(ClientType.PartitionedQueue, ClientType.PartitionedQueue); await testAutoComplete(); }); - it("AutoComplete removes the message from Partitioned Subscription", async function(): Promise< - void - > { + it("Partitioned Subscription: AutoComplete removes the message", async function(): Promise { await beforeEachTest(ClientType.PartitionedTopic, ClientType.PartitionedSubscription); await testAutoComplete(); }); - it("AutoComplete removes the message from UnPartitioned Queue", async function(): Promise { + it("UnPartitioned Queue: AutoComplete removes the message", async function(): Promise { await beforeEachTest(ClientType.UnpartitionedQueue, ClientType.UnpartitionedQueue); await testAutoComplete(); }); - it("AutoComplete removes the message from UnPartitioned Subscription", async function(): Promise< + it("UnPartitioned Subscription: AutoComplete removes the message", async function(): Promise< void > { await beforeEachTest(ClientType.UnpartitionedTopic, ClientType.UnpartitionedSubscription); @@ -194,28 +192,28 @@ describe("Streaming Receiver - Misc Tests", function(): void { should.equal(unexpectedError, undefined, unexpectedError && unexpectedError.message); } - it("Disabled autoComplete, no manual complete retains the message in Partitioned Queue", async function(): Promise< + it("Partitioned Queue: Disabled autoComplete, no manual complete retains the message", async function(): Promise< void > { await beforeEachTest(ClientType.PartitionedQueue, ClientType.PartitionedQueue); await testManualComplete(); }); - it("Disabled autoComplete, no manual complete retains the message in Partitioned Subscription", async function(): Promise< + it("Partitioned Subscription: Disabled autoComplete, no manual complete retains the message", async function(): Promise< void > { await beforeEachTest(ClientType.PartitionedTopic, ClientType.PartitionedSubscription); await testManualComplete(); }); - it("Disabled autoComplete, no manual complete retains the message in UnPartitioned Queue", async function(): Promise< + it("UnPartitioned Queue: Disabled autoComplete, no manual complete retains the message", async function(): Promise< void > { await beforeEachTest(ClientType.UnpartitionedQueue, ClientType.UnpartitionedQueue); await testManualComplete(); }); - it("Disabled autoComplete, no manual complete retains the message in UnPartitioned Subscription", async function(): Promise< + it("UnPartitioned Subscription: Disabled autoComplete, no manual complete retains the message", async function(): Promise< void > { await beforeEachTest(ClientType.UnpartitionedTopic, ClientType.UnpartitionedSubscription); @@ -223,7 +221,7 @@ describe("Streaming Receiver - Misc Tests", function(): void { }); }); -describe("Streaming Receiver - Complete message", function(): void { +describe("Streaming - Complete message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -304,7 +302,7 @@ describe("Streaming Receiver - Complete message", function(): void { }); }); -describe("Streaming Receiver - Abandon message", function(): void { +describe("Streaming - Abandon message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -384,7 +382,7 @@ describe("Streaming Receiver - Abandon message", function(): void { }); }); -describe("Streaming Receiver - Defer message", function(): void { +describe("Streaming - Defer message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -488,7 +486,7 @@ describe("Streaming Receiver - Defer message", function(): void { }); }); -describe("Streaming Receiver - Deadletter message", function(): void { +describe("Streaming - Deadletter message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -585,7 +583,7 @@ describe("Streaming Receiver - Deadletter message", function(): void { }); }); -describe("Streaming Receiver - Multiple Streaming Receivers", function(): void { +describe("Streaming - Multiple Streaming Receivers", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -617,28 +615,28 @@ describe("Streaming Receiver - Multiple Streaming Receivers", function(): void { should.equal(errorWasThrown, true, "Error thrown flag must be true"); } - it("Second Streaming Receiver call should fail if the first one is not stopped for Partitioned Queue", async function(): Promise< + it("Partitioned Queue: Second Streaming Receiver call should fail if the first one is not stopped", async function(): Promise< void > { await beforeEachTest(ClientType.PartitionedQueue, ClientType.PartitionedQueue); await testMultipleReceiveCalls(receiverClient); }); - it("Second Streaming Receiver call should fail if the first one is not stopped for Partitioned Subscription", async function(): Promise< + it("Partitioned Subscription: Second Streaming Receiver call should fail if the first one is not stopped", async function(): Promise< void > { await beforeEachTest(ClientType.PartitionedTopic, ClientType.PartitionedSubscription); await testMultipleReceiveCalls(receiverClient); }); - it("Second Streaming Receiver call should fail if the first one is not stopped for UnPartitioned Queue", async function(): Promise< + it("UnPartitioned Queue: Second Streaming Receiver call should fail if the first one is not stopped", async function(): Promise< void > { await beforeEachTest(ClientType.UnpartitionedQueue, ClientType.UnpartitionedQueue); await testMultipleReceiveCalls(receiverClient); }); - it("Second Streaming Receiver call should fail if the first one is not stopped for UnPartitioned Subscription", async function(): Promise< + it("UnPartitioned Subscription: Second Streaming Receiver call should fail if the first one is not stopped", async function(): Promise< void > { await beforeEachTest(ClientType.UnpartitionedTopic, ClientType.UnpartitionedSubscription); @@ -646,7 +644,7 @@ describe("Streaming Receiver - Multiple Streaming Receivers", function(): void { }); }); -describe("Streaming Receiver - Settle an already Settled message throws error", () => { +describe("Streaming - Settle an already Settled message throws error", () => { afterEach(async () => { await afterEachTest(); }); diff --git a/packages/@azure/servicebus/data-plane/test/streamingReceiverSessions.spec.ts b/packages/@azure/servicebus/data-plane/test/streamingReceiverSessions.spec.ts index 6b892ff53633..045c578f09f2 100644 --- a/packages/@azure/servicebus/data-plane/test/streamingReceiverSessions.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/streamingReceiverSessions.spec.ts @@ -106,7 +106,7 @@ async function afterEachTest(): Promise { await ns.close(); } -describe("Streaming Receiver - Misc Tests(with sessions)", function(): void { +describe("Sessions Streaming - Misc Tests", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -138,7 +138,7 @@ describe("Streaming Receiver - Misc Tests(with sessions)", function(): void { await testPeekMsgsLength(receiverClient, 0); } - it("AutoComplete removes the message from Partitioned Queue(with sessions)", async function(): Promise< + it("Partitioned Queue: AutoComplete removes the message(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -148,7 +148,7 @@ describe("Streaming Receiver - Misc Tests(with sessions)", function(): void { await testAutoComplete(); }); - it("AutoComplete removes the message from Partitioned Subscription(with sessions)", async function(): Promise< + it("Partitioned Subscription: AutoComplete removes the message(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -158,7 +158,7 @@ describe("Streaming Receiver - Misc Tests(with sessions)", function(): void { await testAutoComplete(); }); - it("AutoComplete removes the message from UnPartitioned Queue(with sessions)", async function(): Promise< + it("UnPartitioned Queue: AutoComplete removes the message(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -168,7 +168,7 @@ describe("Streaming Receiver - Misc Tests(with sessions)", function(): void { await testAutoComplete(); }); - it("AutoComplete removes the message from UnPartitioned Subscription(with sessions)", async function(): Promise< + it("UnPartitioned Subscription: AutoComplete removes the message(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -212,7 +212,7 @@ describe("Streaming Receiver - Misc Tests(with sessions)", function(): void { should.equal(receivedMsgs.length, 1, "Unexpected number of messages"); } - it("Disabled autoComplete, no manual complete retains the message in Partitioned Queue(with sessions)", async function(): Promise< + it("Partitioned Queue: Disabled autoComplete, no manual complete retains the message(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -222,7 +222,7 @@ describe("Streaming Receiver - Misc Tests(with sessions)", function(): void { await testManualComplete(); }); - it("Disabled autoComplete, no manual complete retains the message in Partitioned Subscription(with sessions)", async function(): Promise< + it("Partitioned Subscription: Disabled autoComplete, no manual complete retains the message(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -232,7 +232,7 @@ describe("Streaming Receiver - Misc Tests(with sessions)", function(): void { await testManualComplete(); }); - it("Disabled autoComplete, no manual complete retains the message in UnPartitioned Queue(with sessions)", async function(): Promise< + it("UnPartitioned Queue: Disabled autoComplete, no manual complete retains the message(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -242,7 +242,7 @@ describe("Streaming Receiver - Misc Tests(with sessions)", function(): void { await testManualComplete(); }); - it("Disabled autoComplete, no manual complete retains the message in UnPartitioned Subscription(with sessions)", async function(): Promise< + it("UnPartitioned Subscription: Disabled autoComplete, no manual complete retains the message(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -253,7 +253,7 @@ describe("Streaming Receiver - Misc Tests(with sessions)", function(): void { }); }); -describe("Streaming Receiver - Complete message(with sessions)", function(): void { +describe("Sessions Streaming - Complete message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -370,7 +370,7 @@ describe("Streaming Receiver - Complete message(with sessions)", function(): voi }); }); -describe("Streaming Receiver - Abandon message(with sessions)", function(): void { +describe("Sessions Streaming - Abandon message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -495,7 +495,7 @@ describe("Streaming Receiver - Abandon message(with sessions)", function(): void }); }); -describe("Streaming Receiver - Defer message(with sessions)", function(): void { +describe("Sessions Streaming - Defer message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -623,7 +623,7 @@ describe("Streaming Receiver - Defer message(with sessions)", function(): void { }); }); -describe("Streaming Receiver - Deadletter message(with sessions)", function(): void { +describe("Sessions Streaming - Deadletter message", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -742,7 +742,7 @@ describe("Streaming Receiver - Deadletter message(with sessions)", function(): v }); }); -describe("Streaming Receiver - Multiple Streaming Receivers(with sessions)", function(): void { +describe("Sessions Streaming - Multiple Streaming Receivers", function(): void { afterEach(async () => { await afterEachTest(); }); @@ -772,7 +772,7 @@ describe("Streaming Receiver - Multiple Streaming Receivers(with sessions)", fun should.equal(errorWasThrown, true, "Error thrown flag must be true"); } - it("Second Streaming Receiver call should fail if the first one is not stopped for Partitioned Queue(with sessions)", async function(): Promise< + it("Partitioned Queue: Second Streaming Receiver call should fail if the first one is not stopped(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -782,7 +782,7 @@ describe("Streaming Receiver - Multiple Streaming Receivers(with sessions)", fun await testMultipleReceiveCalls(); }); - it("Second Streaming Receiver call should fail if the first one is not stopped for Partitioned Subscription(with sessions)", async function(): Promise< + it("Partitioned Subscription: Second Streaming Receiver call should fail if the first one is not stopped(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -792,7 +792,7 @@ describe("Streaming Receiver - Multiple Streaming Receivers(with sessions)", fun await testMultipleReceiveCalls(); }); - it("Second Streaming Receiver call should fail if the first one is not stopped for UnPartitioned Queue(with sessions)", async function(): Promise< + it("UnPartitioned Queue: Second Streaming Receiver call should fail if the first one is not stopped(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -802,7 +802,7 @@ describe("Streaming Receiver - Multiple Streaming Receivers(with sessions)", fun await testMultipleReceiveCalls(); }); - it("Second Streaming Receiver call should fail if the first one is not stopped for UnPartitioned Subscription(with sessions)", async function(): Promise< + it("UnPartitioned Subscription: Second Streaming Receiver call should fail if the first one is not stopped(with sessions)", async function(): Promise< void > { await beforeEachTest( @@ -813,7 +813,7 @@ describe("Streaming Receiver - Multiple Streaming Receivers(with sessions)", fun }); }); -describe("Streaming Receiver - Settle an already Settled message throws error(with sessions)", () => { +describe("Sessions Streaming - Settle an already Settled message throws error", () => { afterEach(async () => { await afterEachTest(); }); diff --git a/packages/@azure/servicebus/data-plane/test/topicFilters.spec.ts b/packages/@azure/servicebus/data-plane/test/topicFilters.spec.ts index a31b3852cd50..60745e0f1caf 100644 --- a/packages/@azure/servicebus/data-plane/test/topicFilters.spec.ts +++ b/packages/@azure/servicebus/data-plane/test/topicFilters.spec.ts @@ -167,7 +167,7 @@ async function addRules( } } -describe("Topic Filters - Add Rule - Positive Test Cases", function(): void { +describe("addRule()", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.TopicFilterTestSubscription); }); @@ -183,15 +183,15 @@ describe("Topic Filters - Add Rule - Positive Test Cases", function(): void { should.equal(rules[0].name, "BooleanFilter", "RuleName is different than expected"); } - it("Add Rule with Boolean filter - True Filter", async function(): Promise { + it("Add True Filter", async function(): Promise { await BooleanFilter(true); }); - it("Add Rule with Boolean filter - False Filter", async function(): Promise { + it("Add False Filter", async function(): Promise { await BooleanFilter(false); }); - it("Add Rule with SQL filter", async function(): Promise { + it("Add SQL filter", async function(): Promise { await subscriptionClient.addRule( "Priority_1", "(priority = 1 OR priority = 2) AND (sys.label LIKE '%String2')" @@ -201,7 +201,7 @@ describe("Topic Filters - Add Rule - Positive Test Cases", function(): void { should.equal(rules[0].name, "Priority_1", "RuleName is different than expected"); }); - it("Add Rule with SQL filter and action", async function(): Promise { + it("Add SQL filter and action", async function(): Promise { await subscriptionClient.addRule( "Priority_1", "(priority = 1 OR priority = 3) AND (sys.label LIKE '%String1')", @@ -212,7 +212,7 @@ describe("Topic Filters - Add Rule - Positive Test Cases", function(): void { should.equal(rules[0].name, "Priority_1", "RuleName is different than expected"); }); - it("Add Rule with Correlation filter", async function(): Promise { + it("Add Correlation filter", async function(): Promise { await subscriptionClient.addRule("Correlationfilter", { label: "red", correlationId: "high" @@ -221,18 +221,8 @@ describe("Topic Filters - Add Rule - Positive Test Cases", function(): void { should.equal(rules.length, 1, "Unexpected number of rules"); should.equal(rules[0].name, "Correlationfilter", "RuleName is different than expected"); }); -}); - -describe("Topic Filters - Add Rule - Negative Test Cases", function(): void { - beforeEach(async () => { - await beforeEachTest(ClientType.TopicFilterTestSubscription); - }); - afterEach(async () => { - await afterEachTest(); - }); - - it("Adding a rule with a name which matches with existing rule", async function(): Promise { + it("Add rule with a name which matches with existing rule", async function(): Promise { await subscriptionClient.addRule("Priority_1", "priority = 1"); let errorWasThrown = false; try { @@ -253,7 +243,7 @@ describe("Topic Filters - Add Rule - Negative Test Cases", function(): void { should.equal(errorWasThrown, true, "Error thrown flag must be true"); }); - it("Adding a rule with no name", async function(): Promise { + it("Add rule with no name", async function(): Promise { let errorWasThrown = false; try { await subscriptionClient.addRule("", "priority = 2"); @@ -269,7 +259,7 @@ describe("Topic Filters - Add Rule - Negative Test Cases", function(): void { should.equal(errorWasThrown, true, "Error thrown flag must be true"); }); - it("Adding a rule with no filter", async function(): Promise { + it("Add rule with no filter", async function(): Promise { let errorWasThrown = false; try { await subscriptionClient.addRule("Priority_1", ""); @@ -285,7 +275,7 @@ describe("Topic Filters - Add Rule - Negative Test Cases", function(): void { should.equal(errorWasThrown, true, "Error thrown flag must be true"); }); - it("Adding a rule with a Boolean filter whose input is not a Boolean, SQL expression or a Correlation filter", async function(): Promise< + it("Add rule with a Boolean filter whose input is not a Boolean, SQL expression or a Correlation filter", async function(): Promise< void > { let errorWasThrown = false; @@ -322,7 +312,7 @@ describe("Topic Filters - Add Rule - Negative Test Cases", function(): void { }); }); -describe("Topic Filters - Remove Rule", function(): void { +describe("removeRule()", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.TopicFilterTestSubscription); }); @@ -367,7 +357,7 @@ describe("Topic Filters - Remove Rule", function(): void { }); }); -describe("Topic Filters - Get Rules", function(): void { +describe("getRules()", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.TopicFilterTestSubscription); }); @@ -454,7 +444,7 @@ describe("Topic Filters - Get Rules", function(): void { }); }); -describe("Topic Filters - Get Rules - Default Rule", function(): void { +describe("Default Rule - Send/Receive", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.TopicFilterTestDefaultSubscription); }); @@ -470,16 +460,6 @@ describe("Topic Filters - Get Rules - Default Rule", function(): void { should.equal(rules.length, 1, "Unexpected number of rules"); should.equal(rules[0].name, "$Default", "RuleName is different than expected"); }); -}); - -describe("Topic Filters - Send/Receive messages using default filter of subscription", function(): void { - beforeEach(async () => { - await beforeEachTest(ClientType.TopicFilterTestDefaultSubscription); - }); - - afterEach(async () => { - await afterEachTest(false); - }); it("Subscription with default filter receives all messages", async function(): Promise { await sendOrders(); @@ -492,7 +472,7 @@ describe("Topic Filters - Send/Receive messages using default filter of subscri }); }); -describe("Topic Filters - Send/Receive messages using boolean filters of subscription", function(): void { +describe("Boolean Filter - Send/Receive", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.TopicFilterTestSubscription); }); @@ -517,9 +497,7 @@ describe("Topic Filters - Send/Receive messages using boolean filters of subscr return receivedMsgs; } - it("Subscription with true boolean filter receives all messages", async function(): Promise< - void - > { + it("True boolean filter receives all messages", async function(): Promise { const receivedMsgs = await addFilterAndReceiveOrders(true, subscriptionClient, data.length); should.equal(Array.isArray(receivedMsgs), true, "`ReceivedMessages` is not an array"); @@ -528,9 +506,7 @@ describe("Topic Filters - Send/Receive messages using boolean filters of subscr await testPeekMsgsLength(subscriptionClient, 0); }); - it("Subscription with false boolean filter does not receive any messages", async function(): Promise< - void - > { + it("False boolean filter does not receive any messages", async function(): Promise { const receivedMsgs = await addFilterAndReceiveOrders(false, subscriptionClient, 0); should.equal(Array.isArray(receivedMsgs), true, "`ReceivedMessages` is not an array"); @@ -540,7 +516,7 @@ describe("Topic Filters - Send/Receive messages using boolean filters of subscr }); }); -describe("Topic Filters - Send/Receive messages using sql filters of subscription", function(): void { +describe("Sql Filter - Send/Receive", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.TopicFilterTestSubscription); }); @@ -644,7 +620,7 @@ describe("Topic Filters - Send/Receive messages using sql filters of subscripti });*/ }); -describe("Topic Filters - Send/Receive messages using correlation filters of subscription", function(): void { +describe("Correlation Filter - Send/Receive", function(): void { beforeEach(async () => { await beforeEachTest(ClientType.TopicFilterTestSubscription); });