Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void run() {
var primary = resourceCache.get(primaryID);
if (primary.isEmpty()) {
log.warn("No resource in cache for resource ID: {}", primaryID);
// no new execution is scheduled in this case, a on delete event should be received shortly
// no new execution is scheduled in this case, an on delete event should be received shortly
} else {
var actualResources = primary.map(p -> getAndCacheResource(p, false));
scheduleNextExecution(primary.get(), actualResources.orElse(null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,12 @@ void deleteEventCancelsTheScheduling() {
.pollInterval(Duration.ofMillis(20))
.untilAsserted(() -> verify(supplier,times(1)).fetchResources(any()));

when(resourceCache.get(any())).thenReturn(Optional.empty());
source.onResourceDeleted(testCustomResource);

// check if not called again.
await().pollDelay(Duration.ofMillis(PERIOD))
.atMost(Duration.ofMillis((2* PERIOD)))
// check if not called again
await().pollDelay(Duration.ofMillis(2*PERIOD))
.atMost(Duration.ofMillis((4* PERIOD)))
.untilAsserted(() -> verify(supplier,times(1)).fetchResources(any()));
}

Expand Down