package uk.ac.ebi.quickgo.annotation.common.document;

import java.util.Arrays;

/**
 * Class to create stubbed {@link AnnotationDocument} instances.
 *
 * Created 14/04/16
 * @author Edd
 */
public class AnnotationDocMocker {
    private AnnotationDocMocker() {}

    public static AnnotationDocument createAnnotationDoc(String geneProductId) {
        AnnotationDocument doc = new AnnotationDocument();
        doc.geneProductId = geneProductId;

        // automatically compute a document identifier,
        // to overcome non-uniqueness of all other annotation fields
        // (in solrconfig.xml this is set automatically as a UUID)
        doc.id = geneProductId + "-" + System.nanoTime();

        doc.goId = "GO:0003824";
        doc.ecoId = "ECO:0000256";
        doc.qualifier = "enables";
        doc.goEvidence = "IEA";
        doc.reference = "GO_REF:0000002";
        doc.withFrom = Arrays.asList("InterPro:IPR015421", "InterPro:IPR015422");
        doc.interactingTaxonId = 35758;
        doc.assignedBy = "InterPro";
        doc.extensions = Arrays.asList(
                "results_in_development_of(UBERON:0001675),acts_on_population_of(CL:0000032)",
                "results_in_development_of(UBERON:0006000)"
        );

        doc.dbObjectSymbol = "moeA5";
        doc.dbObjectType = "protein";
        doc.dbSubset = "TrEMBL";
        doc.taxonId = 12345;

        return doc;
    }
}

@@ -1400,11 +1400,1016 @@
 c;%0A    %7D
+%0A%0A    public static AnnotationDocument createAnnotationDoc2(String geneProductId) %7B%0A        AnnotationDocument doc = new AnnotationDocument();%0A        doc.geneProductId = geneProductId;%0A%0A        // automatically compute a document identifier,%0A        // to overcome non-uniqueness of all other annotation fields%0A        // (in solrconfig.xml this is set automatically as a UUID)%0A        doc.id = geneProductId + %22-%22 + System.nanoTime();%0A%0A        doc.goId = %22GO:0003824%22;%0A        doc.ecoId = %22ECO:0000323%22;%0A        doc.qualifier = %22involved_in%22;%0A        doc.goEvidence = %22IDA%22;%0A        doc.reference = %22GO_REF:0000038%22;%0A        doc.withFrom = Arrays.asList(%22InterPro:IPR015421%22,%22InterPro:IPR015422%22);%0A        doc.interactingTaxonId = 35758;%0A        doc.assignedBy = %22UniProt%22;%0A        doc.extensions = Arrays.asList(%22occurs_in(CL:1000428)%22);%0A        doc.dbObjectSymbol = %22A0A000%22;%0A        doc.dbObjectType = %22complex%22;%0A        doc.dbSubset = %22TrEMBL%22;%0A        doc.taxonId = 99999;%0A        return doc;%0A    %7D
 %0A%7D%0A

Create a completely new AnnotationDocument thoroughly different to the first test one, so we can test checking filtering by two differing values.