title: Mocktesting RestTemplate using Mockito in Spring boot latest version
body: <p>I am using 1.3.3.RELEASE version of Spring Boot.</p>
  
  <p>I am trying to unit test my service which uses RestTemplate to call a url for fetching html page.</p>
  
  <p>This is the code</p>
  
  <pre><code>Mockito.when(restTemplate.exchange(  
  Mockito.anyString(),  
  Mockito.any(HttpMethod.class),  
  Mockito.any(HttpEntity.class),  
  Mockito.any(Class.class)))  
  .thenReturn(new ResponseEntity&lt;String&gt;("",   
  new HttpHeaders(), HttpStatus.OK));  
  </code></pre>
  
  <p>But thenReturn part is having issues. What could be the right construction of ResponseEntity for getting an html page.</p>
  
  <p>Appreciate any help.</p>
  
  <p>Thanks</p>