title: Mockito for Resttemplate exchange method
body: <pre><code>@Mock
  private RestTemplate restTemplate;
  
  @Test
  public void getWebDlpPoliciesTest() throws Exception {
      String responseValue = &quot;{\n&quot; +
              &quot;    \&quot;policies\&quot;: [\n&quot; +
              &quot;        {\n&quot; +
              &quot;            \&quot;lastUpdatedBy\&quot;: \&quot;15678000\&quot;,\n&quot; +
              &quot;            \&quot;lastUpdatedTime\&quot;: \&quot;test@gmail.com\&quot;,\n&quot; +
              &quot;            \&quot;description\&quot;: \&quot;This rule set blocks the transfer of sensitive information outside your organization's network based on DLP Classifications that McAfee maintains and that you can configure.\&quot;,\n&quot; +
              &quot;            \&quot;publishedStatus\&quot;: \&quot;PUBLISHED\&quot;,\n&quot; +
              &quot;            \&quot;enabled\&quot;: \&quot;true\&quot;,\n&quot; +
              &quot;            \&quot;name\&quot;: \&quot;DLP Classification\&quot;,\n&quot; +
              &quot;            \&quot;id\&quot;: \&quot;DLP_Classification_Rules\&quot;\n&quot; +
              &quot;        }\n&quot; +
              &quot;\t\t\t\t]\n&quot; +
              &quot;}&quot;;
      ResponseEntity&lt;Object&gt; stringResponse = new ResponseEntity&lt;&gt;(responseValue, HttpStatus.OK);
      when(restTemplate.exchange(anyString(), HttpMethod.GET, anyObject(), (Class&lt;Object&gt;) anyObject())).thenReturn(stringResponse);
  }
  </code></pre>
  <hr />
  <p><strong>Error:</strong></p>
  <pre><code>getting error like org.mockito.exceptions.misusing.InvalidUseOfMatchersException: 
  Invalid use of argument matchers!
  4 matchers expected, 3 recorded:
  </code></pre>