Exemplo n.º 1
0
  @Test
  public void normalBackpressured() {
    AssertSubscriber<Integer> ts = AssertSubscriber.create(0);

    Flux.range(1, 10).reduceWith(() -> 0, (a, b) -> b).subscribe(ts);

    ts.assertNoValues().assertNoError().assertNotComplete();

    ts.request(2);

    ts.assertValues(10).assertComplete().assertNoError();
  }
Exemplo n.º 2
0
  @Test
  public void normalBackpressuredArray() {
    AssertSubscriber<Integer> ts = AssertSubscriber.create(2);

    Flux.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).filter(v -> v % 2 == 0).subscribe(ts);

    ts.assertValues(2, 4).assertNotComplete().assertNoError();

    ts.request(10);

    ts.assertValues(2, 4, 6, 8, 10).assertComplete().assertNoError();
  }