title: How to write unit test for a WebFilter that is writing a Reactor Context? Specifically, what and how do I mock?
body: <p>Suppose I have this simple webfilter that just writes a reactor context</p>
  <pre><code>WebFilter filter = (serverWebExchange, webFilterChain) -&gt;
      webFilterChain
          .filter(serverWebExchange)
          .contextWrite(Context.of(&quot;my-key&quot;, true));
  </code></pre>
  <p>I'd imagine the test will look something like this:</p>
  <pre><code>StepVerifier.create(filter.filter(serverWebExchange, webFilterChain)
      .expectAccessibleContext()
      .hasKey(&quot;my-key&quot;)
      .then()
      .verifyComplete();
  </code></pre>
  <p>But I'm not sure how to mock the <code>webFilterChain</code> to make sure the Context is written.</p>
  <pre><code>Mockito.when(webFilterChain.filter(any()).thenReturn(???)
  </code></pre>
  <p>Any ideas?</p>