@Test
public void testCustomAnnotation() throws Exception {
annotate(new Query(), new QueryOptions());
checkAnnotation(v -> true);
DummyVariantDBAdaptor dbAdaptor = mockVariantDBAdaptor();
File file = opencga.createFile(studyId, "custom_annotation/myannot.gff", sessionId);
QueryOptions options = new QueryOptions()
.append(VariantAnnotationManager.LOAD_FILE, file.getId())
.append(VariantAnnotationManager.CUSTOM_ANNOTATION_KEY, "myAnnot");
options.put(StorageOperation.CATALOG_PATH, outputId);
variantManager.annotate(String.valueOf(studyId), new Query(), opencga.createTmpOutdir(studyId, "annot", sessionId), options, sessionId);
verify(dbAdaptor, atLeastOnce()).updateCustomAnnotations(any(), matches("myAnnot"), any(), anyLong(), any());
file = opencga.createFile(studyId, "custom_annotation/myannot.bed", sessionId);
options = new QueryOptions()
.append(VariantAnnotationManager.LOAD_FILE, file.getId())
.append(VariantAnnotationManager.CUSTOM_ANNOTATION_KEY, "myAnnot2");
options.put(StorageOperation.CATALOG_PATH, outputId);
variantManager.annotate(String.valueOf(studyId), new Query(), opencga.createTmpOutdir(studyId, "annot", sessionId), options, sessionId);
verify(dbAdaptor, atLeastOnce()).updateCustomAnnotations(any(), matches("myAnnot2"), any(), anyLong(), any());
}