title: Junit returning null pointer exception
body: <p>I am writing junit for the below case, </p>
  
  <pre><code>public void request (Message msg) {
      String s = msg.getPayload().getSerial();
  }
  </code></pre>
  
  <p>Junit</p>
  
  <pre><code>@Test
  public void requestTest() {
      Message msg = mock(Message.class);
      Mockito.when(msg.getPayload().getSerial()).thenReturn("tet"); --&gt; This returns null
  }
  </code></pre>
  
  <p>Any help</p>