@Test public void resolveTermReturnsTermFromTermId() throws Exception { final String hpoId = "HP:01"; final VocabularyTerm hpoTerm = mock(VocabularyTerm.class); final String hgncId = "HGNC:01"; final VocabularyTerm hgncTerm = mock(VocabularyTerm.class); final String omimId = "MIM:01"; final VocabularyTerm omimTerm = mock(VocabularyTerm.class); final String ethnicityId = "ETHNO:ABC"; final VocabularyTerm ethnicityTerm = mock(VocabularyTerm.class); final String chebiId = "CHEBI:01"; final VocabularyTerm chebiTerm = mock(VocabularyTerm.class); when(this.hpo.getTerm(hpoId)).thenReturn(hpoTerm); when(this.hgnc.getTerm(hgncId)).thenReturn(hgncTerm); when(this.omim.getTerm(omimId)).thenReturn(omimTerm); when(this.ethnicity.getTerm(ethnicityId)).thenReturn(ethnicityTerm); when(this.chebi.getTerm(chebiId)).thenReturn(chebiTerm); Assert.assertEquals(hpoTerm, this.vocabularyManager.resolveTerm(hpoId)); Assert.assertEquals(hgncTerm, this.vocabularyManager.resolveTerm(hgncId)); Assert.assertEquals(omimTerm, this.vocabularyManager.resolveTerm(omimId)); Assert.assertEquals(ethnicityTerm, this.vocabularyManager.resolveTerm(ethnicityId)); Assert.assertEquals(chebiTerm, this.vocabularyManager.resolveTerm(chebiId)); }
@Override public VocabularyTerm resolveTerm(String termId) { Vocabulary vocabulary = getVocabularyForTerm(termId); if (vocabulary != null) { return vocabulary.getTerm(termId); } return null; }
DefaultVocabularyManager implements VocabularyManager { @Override public VocabularyTerm resolveTerm(String termId) { Vocabulary vocabulary = getVocabularyForTerm(termId); if (vocabulary != null) { return vocabulary.getTerm(termId); } return null; } }
DefaultVocabularyManager implements VocabularyManager { @Override public VocabularyTerm resolveTerm(String termId) { Vocabulary vocabulary = getVocabularyForTerm(termId); if (vocabulary != null) { return vocabulary.getTerm(termId); } return null; }  }
DefaultVocabularyManager implements VocabularyManager { @Override public VocabularyTerm resolveTerm(String termId) { Vocabulary vocabulary = getVocabularyForTerm(termId); if (vocabulary != null) { return vocabulary.getTerm(termId); } return null; }  @Override VocabularyTerm resolveTerm(String termId); @Override Vocabulary getVocabulary(String vocabularyId); @Override Set<Vocabulary> getVocabularies(final String category); @Override List<String> getAvailableVocabularies(); @Override List<String> getAvailableCategories(); @Override List<VocabularyTerm> search(@Nullable final String input, @Nullable final String category,
        final int maxResults); @Override boolean hasVocabulary(final String vocabulary); @Override boolean hasCategory(final String category); }
DefaultVocabularyManager implements VocabularyManager { @Override public VocabularyTerm resolveTerm(String termId) { Vocabulary vocabulary = getVocabularyForTerm(termId); if (vocabulary != null) { return vocabulary.getTerm(termId); } return null; }  @Override VocabularyTerm resolveTerm(String termId); @Override Vocabulary getVocabulary(String vocabularyId); @Override Set<Vocabulary> getVocabularies(final String category); @Override List<String> getAvailableVocabularies(); @Override List<String> getAvailableCategories(); @Override List<VocabularyTerm> search(@Nullable final String input, @Nullable final String category,
        final int maxResults); @Override boolean hasVocabulary(final String vocabulary); @Override boolean hasCategory(final String category);  }