@Test
public void createPolicyBadXMLTest() {

    // Setup:
    doThrow(new PolicySyntaxException()).when(policyManager).createPolicy(any(PolicyType.class));
    Response response = target().path("policies").request().post(Entity.json("{\"PolicyId\": \"urn:test\"}"));
    assertEquals(response.getStatus(), 400);
    verify(policyManager).createPolicy(any(PolicyType.class));
    verify(policyManager, times(0)).addPolicy(any(XACMLPolicy.class));
}