title: Mocking superclass method call using mockito is not working
body: <p>I have been trying to stub the superclass method call from the subclass overridden method, but till now I am stuck without any luck to succeed. I have extensively searched on the google and SO questions as well.</p>
  <p>Here is the test code that I am using. The problem is that, in my case, both the superclass and subclass methods are getting stubbed.</p>
  <pre><code>@Test(enabled = true)
  public void superclassMockTest() throws Exception {
  
      ChildClass adc = getChildClass ();
  
      doReturn(getReturnObject())
              .when((SuperClass) adc).getObject(any(String.class), any(String.class), any(Map.class))
      
      ResultObject result= adc.getObject(&quot;acc&quot;, &quot;abc&quot;, null);
      assertNotNull(result);
      assertNotNull(result.getPropertyValue(&quot;attribute&quot;));
  }
  </code></pre>
  <p>The property is set on the <code>ResultObject</code> in the <code>Subclass's getObject(...) method</code>. I want to stub the <code>super.getObject(...) call within the subclass's to return some arbitrary object</code> which is provided by <code>getReturnObject() method</code>.</p>
  <p>The problem that is occurring is that: even the call <code>ResultObject result= adc.getObject(&quot;acc&quot;, &quot;abc&quot;, null);</code> is getting stubbed and the property is not getting set, which is causing the problem.</p>
  <p>I even tried adding: <code>doCallRealMethod().when(adc).getObject(any(String.class), any(String.class), any(Map.class));</code> just before the actual call on the instance, hoping that the actual method on the instance is called. But in this case, the super.getObject(...) is not getting stubbed and getting executed.</p>
  <p>It's kind of either or situation into which I am stuck, I can either stub both or can't stub any. Please help!</p>