Skip to content

Commit

Permalink
ServiceBusReceiverClientIntegrationTest::peekMessage - wait after sen…
Browse files Browse the repository at this point in the history
…d and before peeking
  • Loading branch information
anuchandy committed Jan 14, 2025
1 parent 44f4548 commit 9f37782
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ void receiveMessageAndComplete(MessagingEntityType entityType, boolean isSession
*/
@MethodSource("com.azure.messaging.servicebus.IntegrationTestBase#messagingEntityWithSessions")
@ParameterizedTest
void peekMessage(MessagingEntityType entityType, boolean isSessionEnabled) {
void peekMessage(MessagingEntityType entityType, boolean isSessionEnabled) throws InterruptedException {
// Arrange
setSender(entityType, TestUtils.USE_CASE_DEFAULT, isSessionEnabled);

Expand All @@ -397,6 +397,8 @@ void peekMessage(MessagingEntityType entityType, boolean isSessionEnabled) {

setReceiver(entityType, TestUtils.USE_CASE_DEFAULT, isSessionEnabled);

TimeUnit.SECONDS.sleep(5);

// Act
ServiceBusReceivedMessage receivedMessage = receiver.peekMessage();
logMessage(receivedMessage, receiver.getEntityPath(), "peeked messages");
Expand Down

0 comments on commit 9f37782

Please sign in to comment.