title: How to write JUnit for Spring WebFilter?
body: <p>I have a <code>CustomWebFilter</code> class implementing <code>org.springframework.web.server.WebFilter</code> interface.</p>
  
  <pre><code>@Component
  public class CustomWebFilter implements WebFilter {
      @Override
      public Mono&lt;Void&gt; filter(ServerWebExchange serverWebExchange, 
        WebFilterChain webFilterChain) {
          if(&lt;expression&gt;){
              ServerHttpRequest mutatedRequest = exchange.getRequest()
                      .mutate()
                      .header("new-header-key", "new-header-value")
                      .build();
  
              ServerWebExchange mutatedExchange = exchange.mutate()
                      .request(mutatedRequest)
                      .build();
              return webFilterChain.filter(mutatedExchange);
          }
          return webFilterChain.filter(exchange);
      }
  }
  </code></pre>
  
  <p>As the method <code>filter</code> return type is <code>Mono&lt;Void&gt;</code>, how I can verify the change in request by writing JUnit test?</p>