title: How do i mock RestTemplate exchange
body: <p>Trying the mocking as below :</p>
  
  <pre><code>Mockito.doReturn(responseEntity).when(restTemplate.exchange(anyString(), anyObject(), anyObject(), anyObject()));
  </code></pre>
  
  <p>this gave me a compilation issue:</p>
  
  <p>"The method exchange(String, HttpMethod, HttpEntity, Class, Object[]) is ambiguous for the type RestTemplate"</p>
  
  <p>so tried :</p>
  
  <pre><code>GetRelationshipInfoResponse relationship = getEntity();
          ResponseEntity&lt;GetRelationshipInfoResponse&gt; responseEntity = new ResponseEntity&lt;GetRelationshipInfoResponse&gt;(relationship,
                  HttpStatus.ACCEPTED);
          Mockito.doReturn(responseEntity).when(restTemplate.exchange(anyString(), Matchers.eq(HttpMethod.POST),
                  Matchers.&lt;HttpEntity&lt;?&gt;&gt; any(), Matchers.&lt;Class&lt;Object&gt;&gt; any()));
  </code></pre>
  
  <p>I see in runtime now in <code>MethodInterceptorFilter</code>.intercept is getting null object value.</p>
  
  <p>Can anybody suggest how can I fix.</p>