title: Mockito - mock method call just for particular parameter
body: <p>I want to mock a method call for a specific parameter and call the real method for the others.
  I have:</p>
  
  <pre><code>@TestInstance(TestInstance.Lifecycle.PER_CLASS)
  @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
  @SpringBootTest(classes = AppConfig.class)
  @ActiveProfiles("mvntest")
  public class OKMMoveMergeTest {
      @MockBean
      private FolderDAO folderDAO;
      ...
  
      @Test
      public void callDocCreateEp() throws Exception {
          Mockito.doCallRealMethod().when(folderDAO).getFoldersHierarchy(any(EHierarchyType.class));
          Mockito.doReturn(screwedHierarchy).when(folderDAO).getFoldersHierarchy(EHierarchyType.CLIENT_DOC);
  
          ...
      }
  }
  </code></pre>
  
  <p>With this, I get mocked result for <code>folderDAO.getFoldersHierarchy(EHierarchyType.CLIENT_DOC)</code> but when I try to call it with any other parameter I get <code>NullPointerException</code></p>
  
  <p>so what am I doing wrong or how should I stub the method call just for a particular parameter?</p>
  
  <p>junit-jupiter-api: 5.4.0</p>
  
  <p>junit-jupiter-engine: 5.4.0</p>
  
  <p>spring-boot: 2.1.4.RELEASE
  mockito-junit-jupiter: 2.23.0</p>