@Test
public void createPolicyErrorTest() {

    // Setup
    doThrow(new IllegalStateException()).when(policyManager).addPolicy(policy);
    Response response = target().path("policies").request().post(Entity.json(json));
    assertEquals(response.getStatus(), 500);
    verify(policyManager).createPolicy(any(PolicyType.class));
    verify(policyManager).addPolicy(policy);
}