@Test
public void retrievePolicyTest() {

    Response response = target().path("policies/" + encode(policyId.stringValue())).request().get();
    assertEquals(response.getStatus(), 200);
    verify(policyManager).getPolicy(policyId);
    try {
        JSONObject result = JSONObject.fromObject(response.readEntity(String.class));
        String id = result.optString("PolicyId");
        assertNotNull(id);
        assertEquals(id, policyId.stringValue());
    } catch (Exception e) {
        fail("Expected no exception, but got: " + e.getMessage());
    }
}