@Test
public void getPoliciesTest() {

    Response response = target().path("policies").request().get();
    assertEquals(response.getStatus(), 200);
    verify(policyManager).getPolicies(any(PolicyQueryParams.class));
    try {
        JSONArray result = JSONArray.fromObject(response.readEntity(String.class));
        assertEquals(result.size(), 1);
        JSONObject policyObj = result.optJSONObject(0);
        assertNotNull(policyObj);
        String id = policyObj.optString("PolicyId");
        assertNotNull(id);
        assertEquals(id, policyId.stringValue());
    } catch (Exception e) {
        fail("Expected no exception, but got: " + e.getMessage());
    }
}