@Test
public void getDatasetRecordWithIllegalStateTest() {

    doThrow(new IllegalStateException()).when(datasetManager).getDatasetRecord(any(Resource.class));
    Response response = target().path("datasets/" + encode(record1.getResource().stringValue())).request().get();
    assertEquals(response.getStatus(), 500);
    verify(datasetManager).getDatasetRecord(record1.getResource());
}