I am using spring webflux in my project. My controller class calls service class methods which returns Mono or Flux.
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.
Now I want to write unit tests for my service class methods(by mocking database class)
Any ideas on how to achieve this? Should I use call the service class method from test and call block()
or is there a better way?