title: Is there a way to mock method calls on a local object
body: <p>I am using Mockito framework to write test cases for an existing spring-boot project.</p>
  
  <p>In one of the class, they have created local instance of <code>rest-template</code> inside a function instead of <code>@Autowiring</code>. </p>
  
  <pre><code>public LatxDetails getLatxCaseDetail_Fallback(String endpoint, Map&lt;String, String&gt; requestMap) {
  
  //some code
  
  RestTemplate restTemplate = new RestTemplate(); 
  ResponseEntity&lt;String&gt; response = restTemplate.exchange(kxCreateEndpoint, HttpMethod.POST, httpEntity, String.class);
  
  //some code
  </code></pre>
  
  <p>I am unable to mock the rest call.I can't add any other external jars or change code. How should I proceed? Any help is really appreciated. </p>