@Test void testGetOntology() { ontologyEntity = mock(org.molgenis.ontology.core.meta.Ontology.class); when(ontologyEntity.getString(ID)).thenReturn("1"); when(ontologyEntity.getString(ONTOLOGY_IRI)).thenReturn("http: when(ontologyEntity.getString(ONTOLOGY_NAME)).thenReturn("testOntology"); @SuppressWarnings("unchecked") Query<org.molgenis.ontology.core.meta.Ontology> query = mock(Query.class, RETURNS_SELF); when(dataService.query(ONTOLOGY, org.molgenis.ontology.core.meta.Ontology.class)) .thenReturn(query); when(query.eq(ONTOLOGY_IRI, "http: .thenReturn(ontologyEntity); assertEquals( create("1", "http: ontologyRepository.getOntology("http: }
public Ontology getOntology(String iri) { org.molgenis.ontology.core.meta.Ontology ontology = dataService .query(ONTOLOGY, org.molgenis.ontology.core.meta.Ontology.class) .eq(ONTOLOGY_IRI, iri) .findOne(); return toOntology(ontology); }
OntologyRepository { public Ontology getOntology(String iri) { org.molgenis.ontology.core.meta.Ontology ontology = dataService .query(ONTOLOGY, org.molgenis.ontology.core.meta.Ontology.class) .eq(ONTOLOGY_IRI, iri) .findOne(); return toOntology(ontology); } }
OntologyRepository { public Ontology getOntology(String iri) { org.molgenis.ontology.core.meta.Ontology ontology = dataService .query(ONTOLOGY, org.molgenis.ontology.core.meta.Ontology.class) .eq(ONTOLOGY_IRI, iri) .findOne(); return toOntology(ontology); }  }
OntologyRepository { public Ontology getOntology(String iri) { org.molgenis.ontology.core.meta.Ontology ontology = dataService .query(ONTOLOGY, org.molgenis.ontology.core.meta.Ontology.class) .eq(ONTOLOGY_IRI, iri) .findOne(); return toOntology(ontology); }  Stream<Ontology> getOntologies(); Stream<Ontology> getOntologies(List<String> ontologyIds); Ontology getOntology(String iri); }
OntologyRepository { public Ontology getOntology(String iri) { org.molgenis.ontology.core.meta.Ontology ontology = dataService .query(ONTOLOGY, org.molgenis.ontology.core.meta.Ontology.class) .eq(ONTOLOGY_IRI, iri) .findOne(); return toOntology(ontology); }  Stream<Ontology> getOntologies(); Stream<Ontology> getOntologies(List<String> ontologyIds); Ontology getOntology(String iri);  }