title: Retrieve all flux elements in StepVerifier
body: <p>I am working on testing a flux. I don't know how many elements exactly the flux has. Initially I have tried with StepVerifier and faced issues as i do not know the elements. Later I have referred this <a href="https://stackoverflow.com/questions/44762798/how-to-perform-assertion-on-all-remaining-elements-in-stepverifier">question</a> and tried the same but I am getting the below error:
  <code>java.lang.AssertionError: expectation "expectComplete" failed (expected: onComplete(); actual: onNext</code></p>
  
  <p>My understanding is that, my code is expecting a complete signal but the flux has some more elements left(so it gives onNext() instead of onComplete()). Please help me to understand where I am missing things. Below is my code:</p>
  
  <pre><code>StepVerifier.create(flux)
              .recordWith(ArrayList::new)
              .consumeRecordedWith(elements-&gt; {assertThat(elements.size()).isGreaterThan(0);})
              .verifyComplete();
  </code></pre>