Code for Get call using web client which I am trying to unit test
webClient.get().uri("http://localhost:8080/employee/{id}", xyz).retrieve().bodyToMono(String.class);
Code for Get call using web client which I am trying to unit test
webClient.get().uri("http://localhost:8080/employee/{id}", xyz).retrieve().bodyToMono(String.class);
Something like this should work
doReturn(requestHeadersUriMock).when(webClientMock).get();
doReturn(requestHeadersMock).when(requestHeadersUriMock)
.uri(anyString());
doReturn(responseMock).when(requestHeadersMock).retrieve();
doReturn(Mono.just(....)).when(responseMock).bodyToMono(String.class);
//Assertions