title: Mockito mocking retrytemplate.execute and return mocked response
body: <p>Below is the code I want to test:</p>
  <pre><code>@Autowired
  RetryTemplate retryTemplate;
  
  MyResponse response;
  
  response = retryTemplate.execute(new RetryCallback&lt;Mono&lt;MyResponse&gt;, RuntimeException&gt;() {
      public Mono&lt;MyResponse&gt; doRetry(RetryContext context) {
          return webclient.post.body(Mono.just(requestBodyObj), RequestBodyObj.class).retrieve().bodyToMono(MyResponse.class);
      }
  });
  </code></pre>
  <p>Below is the test case I am trying, but getting Invalid use of matchers exception. Also, I am not sure if my below code would work. Pls guide:</p>
  <pre><code>MyResponse myResponseObj = new MyResponse();
  
  when(retryTemplate.execute(any(RetryCallback.class))).thenAnswer(invocation -&gt; {
          RetryCallback retry = invocation.getArgument(0);
          when(retry.doWithRetry(Mockito.any())).thenReturn(Mockito.eq(Mono.just(myResponseObj)))
          return retry.doWithRetry(null);
      });
  </code></pre>
  <p>Pls guide what is the mistake here and how can I return <code>myResponseObj</code> whenever <code>retry.doWithRetry</code> is called.</p>