How to do integration test for web client?

435 views Asked by At

I have a method which returns Mono. So I try to user step verifier to do a integrate test.

public Mono<Void> process(InputBody body)  {

  retrun webClient
        .post()
        .uri("/submit")
        .body(Mono.just(body), InputBody .class)
        .retrieve()
        .bodyToMono(Void.class)
        .subscribe()      
}

I want to do a integrate test for this.

my question is, when we use Web Client Test how to return mono void and step verify it?

 webClient
        .post()
        .uri("/submit")
        .body(Mono.just(body), InputBody .class)
        .exchange()
      .........

how to complete things? I tried but failed.

0

There are 0 answers