Skip to content

Commit 0ae45ef

Browse files
committed
wip
1 parent 7942cd4 commit 0ae45ef

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/polling/PerResourcePollingEventSourceTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,18 @@ void getsValueFromCacheOrSupplier() {
139139
}
140140

141141
@Test
142-
void dynamicDelaysCanBeImplemented() {
142+
void supportsDynamicPollingDelay() {
143+
when(supplier.fetchResources(any()))
144+
.thenReturn(Set.of(SampleExternalResource.testResource1()));
145+
when(supplier.fetchDelay(any(),any()))
146+
.thenReturn(Optional.of(Duration.ofMillis(PERIOD*2)))
147+
.thenReturn(Optional.of(Duration.ofMillis(PERIOD)));
148+
149+
source.onResourceCreated(testCustomResource);
143150

151+
await().pollDelay(Duration.ofMillis(PERIOD)).untilAsserted(() -> {
152+
// todo
153+
});
144154
}
145155

146156
}

0 commit comments

Comments
 (0)