8000 Step 2: Improved solution · blackbeltcoder/reactive-spring@0721047 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0721047

Browse files
committed
Step 2: Improved solution
1 parent f7da8ff commit 0721047

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

reactor/src/test/java/workshop/Step2Flux.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ public void fluxShouldEmitItemsOverTime() {
6565

6666
Duration duration = Duration.ofSeconds(2);
6767

68-
Flux<Long> flux = Flux.interval(duration);
69-
70-
StepVerifier.create(flux.doOnNext(System.out::println).take(4)).expectNext(0L, 1L, 2L, 3L).verifyComplete();
68+
StepVerifier.withVirtualTime(() -> Flux.interval(duration).doOnNext(System.out::println).take(4))
69+
.thenAwait(Duration.ofSeconds(10)).expectNext(0L, 1L, 2L, 3L).verifyComplete();
7170
}
7271
}

0 commit comments

Comments
 (0)
0