title: How to validate request url in Spring WebClient?
body: <p>I have a <code>WebClient</code> and want to validate the <code>url</code> and the <code>payload</code> that the webclient has send. But how can I get access to it in a <code>junit</code> integration test? Means: how can I record them?</p>
  
  <pre><code>@Service
  public class RestService {
      @Autowired
      private WebClient web;
  
      public Mono&lt;String&gt; send() {
         web.post().uri("/test").bodyValue("testval").retrieve().bodyToMono(String.class);
      }
  }
  
  @SpringBootTest
  public class RestServiceITest {
     @Autowired
     private RestService service;
  
     @Test
     public void testUrl() { 
        service.send();
  
        //TODO how to validate the request uri + body the the webClient received?
     }
  }
  </code></pre>