@Test
public void getRecordsTest() {

    Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records")
            .queryParam("sort", DCTERMS.TITLE.stringValue())
            .queryParam("type", Record.TYPE)
            .queryParam("offset", 0)
            .queryParam("limit", 10)
            .queryParam("ascending", false)
            .queryParam("searchText", "test").request().get();
    assertEquals(response.getStatus(), 200);
    verify(catalogManager).findRecord(eq(vf.createIRI(LOCAL_IRI)), any(PaginatedSearchParams.class));
    MultivaluedMap<String, Object> headers = response.getHeaders();
    assertEquals(headers.get("X-Total-Count").get(0), "" + results.getTotalSize());
    assertEquals(response.getLinks().size(), 0);
    try {
        JSONArray result = JSONArray.fromObject(response.readEntity(String.class));
        assertEquals(result.size(), results.getPage().size());
    } catch (Exception e) {
        fail("Expected no exception, but got: " + e.getMessage());
    }
}