Skip to content

Commit

Permalink
wip: try reordering the operations on the test
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Peterson <[email protected]>
  • Loading branch information
mattp-swirldslabs committed Aug 1, 2024
1 parent 2febc51 commit a08c333
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ public void testOnCancelSubscriptionHandling() throws IOException {
final List<BlockItem> blockItems = generateBlockItems(1);
streamMediator.publishEvent(blockItems.getFirst());

// Verify the event made it to the consumer
verify(serverCallStreamObserver, timeout(50).times(1)).setOnCancelHandler(any());

// Simulate the consumer cancelling the stream
testConsumerBlockItemObserver.getOnCancel().run();

// Verify the event made it to the consumer
verify(serverCallStreamObserver, timeout(50).times(1)).setOnCancelHandler(any());

// Confirm the mediator unsubscribed the consumer
assertFalse(streamMediator.isSubscribed(testConsumerBlockItemObserver));
}
Expand Down Expand Up @@ -258,12 +258,12 @@ public void testOnCloseSubscriptionHandling() throws IOException {
final List<BlockItem> blockItems = generateBlockItems(1);
streamMediator.publishEvent(blockItems.getFirst());

// Verify the event made it to the consumer
verify(serverCallStreamObserver, timeout(50).times(1)).setOnCancelHandler(any());

// Simulate the consumer completing the stream
testConsumerBlockItemObserver.getOnClose().run();

// Verify the event made it to the consumer
verify(serverCallStreamObserver, timeout(50).times(1)).setOnCancelHandler(any());

// Confirm the mediator unsubscribed the consumer
assertFalse(streamMediator.isSubscribed(testConsumerBlockItemObserver));
}
Expand Down

0 comments on commit a08c333

Please sign in to comment.