@Test
public void testDeleteAnnotation() throws CatalogException {
catalogManager.getSampleManager().updateAnnotations(studyFqn, s_1, "annot1", new ObjectMap("EXTRA", "extra"),
ParamUtils.CompleteUpdateAction.ADD, QueryOptions.empty(), sessionIdUser);
Sample sample = catalogManager.getSampleManager().get(studyFqn, s_1, null, sessionIdUser).first();
AnnotationSet annotationSet = sample.getAnnotationSets().get(0);
assertEquals("extra", annotationSet.getAnnotations().get("EXTRA"));
catalogManager.getSampleManager().removeAnnotations(studyFqn, s_1, annotationSet.getId(), Collections.singletonList("EXTRA"),
QueryOptions.empty(), sessionIdUser);
sample = catalogManager.getSampleManager().get(studyFqn, s_1, null, sessionIdUser).first();
annotationSet = sample.getAnnotationSets().get(0);
assertTrue(!annotationSet.getAnnotations().containsKey("EXTRA"));
thrown.expect(CatalogException.class);
thrown.expectMessage("required variable");
catalogManager.getSampleManager().removeAnnotations(studyFqn, s_1, annotationSet.getId(), Collections.singletonList("AGE"),
QueryOptions.empty(), sessionIdUser);
}