@Test
public void getDatasetRecordThatCouldNotBeFoundTest() {

    when(datasetManager.getDatasetRecord(any(Resource.class))).thenReturn(Optional.empty());
    Response response = target().path("datasets/" + encode(record1.getResource().stringValue())).request().get();
    assertEquals(response.getStatus(), 404);
    verify(datasetManager).getDatasetRecord(record1.getResource());
}