MockGafSolrDocumentLoader extends GafSolrDocumentLoader implements MockSolrDocumentLoader { public MockSolrDocumentCollection getDocumentCollection() { return documentCollection; } MockGafSolrDocumentLoader(); @Override void add(SolrInputDocument doc); MockSolrDocumentCollection getDocumentCollection();  }
@Test public void test() throws Exception { GafObjectsBuilder b = new GafObjectsBuilder(); final GafDocument gaf = b.buildDocument("src/test/resources/not_bioentity_closure/mini-test.gaf"); ParserWrapper pw = new ParserWrapper(); OWLOntology testOwl = pw.parse(new File("src/test/resources/not_bioentity_closure/mini-test.obo").getCanonicalPath()); final OWLGraphWrapper g = new OWLGraphWrapper(testOwl); OWLOntology slimOWL = pw.parse(TaxonTools.TAXON_PURL); ElkReasonerFactory rf = new ElkReasonerFactory(); MockGafSolrDocumentLoader l = new MockGafSolrDocumentLoader(); OWLReasoner r = null; try { r = rf.createReasoner(slimOWL); l.setGafDocument(gaf); l.setGraph(g); l.setEcoTools(new EcoTools(pw)); l.setTaxonTools(new TaxonTools(r, true)); l.load(); } finally { if (r != null) { r.dispose(); } } List<Map<String, Object>> docs = l.getDocumentCollection().getDocuments(); assertFalse(docs.size() == 0); Gson gson = new GsonBuilder().setPrettyPrinting().create(); for (Map<String, Object> doc : docs) { String json = gson.toJson(doc); System.out.println(json); } }