...
I think the junit tests are failing because the mockito when method is not compatible with the double method calls of the Invocation.Builder class (the .accept().post()):
when(webResourceBuilder.accept(MediaType.APPLICATION_JSON_TYPE).post(Entity.json(String.class),Response.class)).thenReturn(clientResponse);
...