title: How do I mock a method of a super class by Mockito?
body: <p>I need to mock a call to the findById method of the GenericService.</p>
  
  <p>I've this:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class UserServiceImpl extends GenericServiceImpl&lt;User Integer&gt; implements UserService, Serializable {
  
  .... 
  // This call i want mock
  user = findById(user.getId());
  .....
  // For example this one calls mockeo well. Why is not it a call to the generic service?
  book = bookService.findById(id);
  </code></pre>
  
  <p>The problem is in the first mock since it is a call to a generic service.</p>
  
  <p>The second mock works fine as well</p>
  
  <pre><code>when(bookService.findById(anyInt())).thenReturn(mockedBook);
  </code></pre>