@Test
public void getDatasetRecordsWithErrorTest() {

    // Setup:
    when(datasetManager.getDatasetRecords(any(DatasetPaginatedSearchParams.class))).thenThrow(new MobiException());
    Response response = target().path("datasets").request().get();
    assertEquals(response.getStatus(), 500);
}