title: Spring Boot Test - Mock local object inside method
body: <p>I have a service with a method that includes a local variable (<code>cliente</code>), a pojo, not a bean, and I would like to mock a method of that object (<code>consultaDatos( ... )</code>) in a test. So the code of my service is like this:</p>
  <pre><code>@Service
  public class ServicioFn {
      ...
      public RespuestaConsultaFamiliaNumerosa obtenerDatosFamiliaNumerosa( ... ) {
          Cliente cliente = ...;
          return cliente.consultaDatos( ... );
      }
  }
  </code></pre>
  <p>As <code>cliente</code> is not a bean, <code>@MockBean</code> in my test (it's a <code>@SpringBootTest</code>) doesn't work. How could I mock that object?</p>