title: How to mock RestTemplate getForObject method using jmockit?
body: <p>How to mock <code>getForObject</code> method in <code>RestTemplate</code> class using <code>jmockit</code> - </p>
  
  <p>I am trying to do like this - </p>
  
  <pre><code>   @Test
      public void test2DataClient() {
  
      new MockUp&lt;RestTemplate&gt;() {
  
          @Mock
          public String getForObject(String url, Class&lt;String&gt; responseType, Object... urlVariables) {
          return "{(\"error\": \"missing data id\", \"data_id\":2001)}";
          }
      };  
  }
  </code></pre>
  
  <p>But every time I am getting this error- </p>
  
  <pre><code>java.lang.IllegalArgumentException: Matching real methods not found for the following mocks:
  </code></pre>
  
  <p>Any thoughts what wrong I am doing here?</p>
  
  <p><strong>UPDATE:-</strong></p>
  
  <p>Full StackTrace - </p>
  
  <pre><code>java.lang.IllegalArgumentException: Matching real methods not found for the following mocks:
  com.host.dataclient.test.DataTest$3#getForObject(String url, Class responseType, Object[] urlVariables)
      at com.host.dataclient.test.DataTest$3.&lt;init&gt;(DataTest.java:649)
      at com.host.dataclient.test.DataTest.test25dataclient(DataTest.java:649)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:602)
      at java.lang.reflect.Method.invoke(Method.java:602)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  </code></pre>