@Test public void createLinkedVocabularyRepresentationContainsExpectedData() { final List<org.phenotips.vocabularies.rest.model.Category> categoryReps = Arrays.asList(this.categoryRep1, this.categoryRep2); final org.phenotips.vocabularies.rest.model.Vocabulary vocabulary = this.component.createLinkedVocabularyRepresentation(this.vocabulary1, this.autolinker, this::categoriesSupplier); Assert.assertEquals(VOCAB_1_ID, vocabulary.getIdentifier()); Assert.assertEquals(categoryReps, vocabulary.getCategories()); verify(this.autolinker, times(1)).build(); }
@Override public org.phenotips.vocabularies.rest.model.Vocabulary createLinkedVocabularyRepresentation( final Vocabulary vocabulary, final Autolinker linker, final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier) { final org.phenotips.vocabularies.rest.model.Vocabulary vocabularyRep = categorySupplier != null ? createVocabularyRepresentation(vocabulary).withCategories(categorySupplier.apply(vocabulary)) : createVocabularyRepresentation(vocabulary); vocabularyRep.withLinks(linker.withExtraParameters(VOCABULARY_ID_LABEL, vocabulary.getIdentifier()).build()); return vocabularyRep; }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public org.phenotips.vocabularies.rest.model.Vocabulary createLinkedVocabularyRepresentation( final Vocabulary vocabulary, final Autolinker linker, final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier) { final org.phenotips.vocabularies.rest.model.Vocabulary vocabularyRep = categorySupplier != null ? createVocabularyRepresentation(vocabulary).withCategories(categorySupplier.apply(vocabulary)) : createVocabularyRepresentation(vocabulary); vocabularyRep.withLinks(linker.withExtraParameters(VOCABULARY_ID_LABEL, vocabulary.getIdentifier()).build()); return vocabularyRep; } }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public org.phenotips.vocabularies.rest.model.Vocabulary createLinkedVocabularyRepresentation( final Vocabulary vocabulary, final Autolinker linker, final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier) { final org.phenotips.vocabularies.rest.model.Vocabulary vocabularyRep = categorySupplier != null ? createVocabularyRepresentation(vocabulary).withCategories(categorySupplier.apply(vocabulary)) : createVocabularyRepresentation(vocabulary); vocabularyRep.withLinks(linker.withExtraParameters(VOCABULARY_ID_LABEL, vocabulary.getIdentifier()).build()); return vocabularyRep; }  }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public org.phenotips.vocabularies.rest.model.Vocabulary createLinkedVocabularyRepresentation( final Vocabulary vocabulary, final Autolinker linker, final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier) { final org.phenotips.vocabularies.rest.model.Vocabulary vocabularyRep = categorySupplier != null ? createVocabularyRepresentation(vocabulary).withCategories(categorySupplier.apply(vocabulary)) : createVocabularyRepresentation(vocabulary); vocabularyRep.withLinks(linker.withExtraParameters(VOCABULARY_ID_LABEL, vocabulary.getIdentifier()).build()); return vocabularyRep; }  @Override org.phenotips.vocabularies.rest.model.Vocabulary createVocabularyRepresentation(Vocabulary vocabulary); @Override List<org.phenotips.vocabularies.rest.model.Vocabulary> createVocabulariesRepresentation(
        final Collection<Vocabulary> vocabularies,
        final Autolinker linker,
        final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier); @Override org.phenotips.vocabularies.rest.model.Vocabulary createLinkedVocabularyRepresentation(
        final Vocabulary vocabulary,
        final Autolinker linker,
        final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier); @Override org.phenotips.vocabularies.rest.model.Category createCategoryRepresentation(final String categoryId); @Override List<Category> createCategoriesRepresentation(
        final Collection<String> categoryIds,
        final Autolinker linker,
        final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier); @Override org.phenotips.vocabularies.rest.model.Category createLinkedCategoryRepresentation(
        final String categoryId,
        final Autolinker linker,
        final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier); }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public org.phenotips.vocabularies.rest.model.Vocabulary createLinkedVocabularyRepresentation( final Vocabulary vocabulary, final Autolinker linker, final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier) { final org.phenotips.vocabularies.rest.model.Vocabulary vocabularyRep = categorySupplier != null ? createVocabularyRepresentation(vocabulary).withCategories(categorySupplier.apply(vocabulary)) : createVocabularyRepresentation(vocabulary); vocabularyRep.withLinks(linker.withExtraParameters(VOCABULARY_ID_LABEL, vocabulary.getIdentifier()).build()); return vocabularyRep; }  @Override org.phenotips.vocabularies.rest.model.Vocabulary createVocabularyRepresentation(Vocabulary vocabulary); @Override List<org.phenotips.vocabularies.rest.model.Vocabulary> createVocabulariesRepresentation(
        final Collection<Vocabulary> vocabularies,
        final Autolinker linker,
        final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier); @Override org.phenotips.vocabularies.rest.model.Vocabulary createLinkedVocabularyRepresentation(
        final Vocabulary vocabulary,
        final Autolinker linker,
        final Function<Vocabulary, List<org.phenotips.vocabularies.rest.model.Category>> categorySupplier); @Override org.phenotips.vocabularies.rest.model.Category createCategoryRepresentation(final String categoryId); @Override List<Category> createCategoriesRepresentation(
        final Collection<String> categoryIds,
        final Autolinker linker,
        final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier); @Override org.phenotips.vocabularies.rest.model.Category createLinkedCategoryRepresentation(
        final String categoryId,
        final Autolinker linker,
        final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier);  }