Spring WebClient - Mockito NullPointerException body() is null
I am currently testing a Service performing HTTP requests with WebClient on Spring. When I'm mocking the service I get a NullPointerException on my body when I'm testing a method which performs a POST request. Here is the error : java.lang.NullPointerException: Cannot invoke "org.springframework.web.reactive.function.client.WebClient$RequestHeadersSpec.retrieve()" because the return value of "org.springframework.web.reactive.function.client.WebClient$RequestBodySpec.body(org.reactivestreams.Publisher, java.lang.Class)" is null Here is my code : import com.bluelagoon.payetonkawa.dolibarr.entiti
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.