title: Spring webflux unit test method which returns Mono/Flux
body: <p>I am using spring webflux in my project. My controller class calls service class methods which returns Mono or Flux.  </p>
  
  <p>I am trying to write unit tests for my service class. I am not sure how to write unit tests for a method which returns Mono/Flux. Most of the articles I checked suggested me to use WebclientTest. But the point is, I am testing my service class here. I have used WebclientTest when I tested my web layer(controller class) by mocking service class methods.  </p>
  
  <p>Now I want to write unit tests for my service class methods(by mocking database class) </p>
  
  <p>Any ideas on how to achieve this? Should I use call the service class method from test and call <code>block()</code> or is there a better way?</p>