Skip to content

Commit

Permalink
Merge pre-release changes from 3.1.x
Browse files Browse the repository at this point in the history
This ignored backported changes to build.gradle and changes to README.
  • Loading branch information
simonbasle committed Jan 7, 2019
2 parents 5d74110 + 77eb26c commit 0172767
Showing 1 changed file with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,17 @@ public void throttlerReturnsNull() {

@Test
public void sampleIncludesLastItem() {
Flux<Integer> source = Flux.concat(
Flux.range(1, 5),
Mono.delay(Duration.ofMillis(260)).ignoreElement().map(Long::intValue),
Flux.just(80, 90, 100)
).hide();

Duration duration = StepVerifier.create(source
.sampleTimeout(i -> Mono.delay(Duration.ofMillis(250))))
.expectNext(5)
.expectNext(100)
.verifyComplete();

//sanity check on the sequence duration
assertThat(duration.toMillis()).isLessThan(500);
StepVerifier.withVirtualTime(() ->
Flux.concat(
Flux.range(1, 5),
Mono.delay(Duration.ofMillis(260)).ignoreElement().map(Long::intValue),
Flux.just(80, 90, 100)
).hide()
.sampleTimeout(i -> Mono.delay(Duration.ofMillis(250))))
.thenAwait(Duration.ofMillis(500))
.expectNext(5)
.expectNext(100)
.verifyComplete();
}

@Test
Expand Down

0 comments on commit 0172767

Please sign in to comment.