Is it possible to use stubFor here?
If yes, how to do it?
If not, how to test this code?
public Mono<Void> trelloCallback(Type payload) {
webClient.post()
.uri(URL)
.bodyValue(payload)
.headers(httpHeaders -> httpHeaders.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE))
.retrieve()
.bodyToMono(Void.class)
.subscribe();
return Mono.empty();
}
Info: If we add .subscribe to the code, it runs in the background.