title: How to mock an entity using Mockito
body: <p>I am using Mockito to mock Jersey Client API. I have a mock Response which returns me a <code>nullPointerException</code>.</p>
  
  <p>This is what I have done so far</p>
  
  <p><code>when(invocationBuilder.post(Entity.entity(anyString(),MediaType.APPLICATION_XML))).thenReturn(response);</code></p>
  
  <p>Is there anyway to fix this.
  Thanks,</p>