@Test public void createLinkedCategoryRepresentationContainsExpectedData() { final Category category = this.component.createLinkedCategoryRepresentation(CATEGORY_1_NAME, this.autolinker, this::vocabulariesSupplier); Assert.assertEquals(CATEGORY_1_NAME, category.getCategory()); Assert.assertEquals(Arrays.asList(this.vocabularyRep1, this.vocabularyRep2, this.vocabularyRep3), category.getVocabularies()); verify(this.autolinker, times(1)).build(); }
@Override public org.phenotips.vocabularies.rest.model.Category createLinkedCategoryRepresentation( final String categoryId, final Autolinker linker, final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier) { final Category categoryRep = vocabularySupplier != null ? createCategoryRepresentation(categoryId).withVocabularies(vocabularySupplier.apply(categoryId)) : createCategoryRepresentation(categoryId); categoryRep.withLinks(linker.withExtraParameters(CATEGORY_LABEL, categoryId).build()); return categoryRep; }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public org.phenotips.vocabularies.rest.model.Category createLinkedCategoryRepresentation( final String categoryId, final Autolinker linker, final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier) { final Category categoryRep = vocabularySupplier != null ? createCategoryRepresentation(categoryId).withVocabularies(vocabularySupplier.apply(categoryId)) : createCategoryRepresentation(categoryId); categoryRep.withLinks(linker.withExtraParameters(CATEGORY_LABEL, categoryId).build()); return categoryRep; } }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public org.phenotips.vocabularies.rest.model.Category createLinkedCategoryRepresentation( final String categoryId, final Autolinker linker, final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier) { final Category categoryRep = vocabularySupplier != null ? createCategoryRepresentation(categoryId).withVocabularies(vocabularySupplier.apply(categoryId)) : createCategoryRepresentation(categoryId); categoryRep.withLinks(linker.withExtraParameters(CATEGORY_LABEL, categoryId).build()); return categoryRep; }  }
DefaultDomainObjectFactory implements DomainObjectFactory { @Override public org.phenotips.vocabularies.rest.model.Category createLinkedCategoryRepresentation( final String categoryId, final Autolinker linker, final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier) { final Category categoryRep = vocabularySupplier != null ? createCategoryRepresentation(categoryId).withVocabularies(vocabularySupplier.apply(categoryId)) : createCategoryRepresentation(categoryId); categoryRep.withLinks(linker.withExtraParameters(CATEGORY_LABEL, categoryId).build()); return categoryRep; }  @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.Category createLinkedCategoryRepresentation( final String categoryId, final Autolinker linker, final Function<String, List<org.phenotips.vocabularies.rest.model.Vocabulary>> vocabularySupplier) { final Category categoryRep = vocabularySupplier != null ? createCategoryRepresentation(categoryId).withVocabularies(vocabularySupplier.apply(categoryId)) : createCategoryRepresentation(categoryId); categoryRep.withLinks(linker.withExtraParameters(CATEGORY_LABEL, categoryId).build()); return categoryRep; }  @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);  }