title: Mockito When() is not working
body: <p>So I break down my code a bit to make it more general and also easier for others to understand with the similar issue</p>
  
  <p>this is my main code:</p>
  
  <pre><code>protected void methodA(String name) {
          Invocation.Builder requestBuilder = webTarget.request();
          requestBuilder.header(HttpHeaders.AUTHORIZATION, authent.getPassword());
  
              response = request.invoke();
  
              if (response.equals("unsuccessfull")) {
                  log.warn("warning blabla: {} ({})"); 
              } else {
                  log.info("info blabla {}");
              }
          } 
      }
  }
  </code></pre>
  
  <p>while my test code looks like this:</p>
  
  <pre><code>@Test
  public void testMethodA() throws Exception {            
      final String name = "testName";
  
      this.subject.methodA(name);
  
      Authent authent = Mockito.mock(Authent.class);
  
      when(authent.getPassword()).thenReturn("testPW");
      assertEquals(1, logger.infos.size());
  
  }
  </code></pre>
  
  <p>as I said the code is more complex I broke it down and made it shorter..... hope still it is readable.</p>
  
  <p>My problem is not that my <code>when().thenReturn()</code> doesn't work and therefore my code doesn't proceed further.... I guess my mocking doesn't work properly for some reason.</p>