Skip to content

Commit

Permalink
Fixup jmock TableLocation expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind committed Oct 22, 2024
1 parent c48d65d commit bcd681e
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,23 @@ public void testRefreshing() {
checkIndexes();
assertEquals(Arrays.asList(tableLocation0A, tableLocation1A, tableLocation0B, tableLocation1B),
SUT.includedLocations());

// expect table locations to be cleaned up via LivenessScope release as the test exits
IntStream.range(0, tableLocations.length).forEachOrdered(li -> {
final TableLocation tl = tableLocations[li];
checking(new Expectations() {
{
oneOf(tl).supportsSubscriptions();
if (li % 2 == 0) {
// Even locations don't support subscriptions
will(returnValue(false));
} else {
will(returnValue(true));
oneOf(tl).unsubscribe(with(subscriptionBuffers[li]));
}
}
});
});
}

private static void maybePrintStackTrace(@NotNull final Exception e) {
Expand Down

0 comments on commit bcd681e

Please sign in to comment.