@Test public void getAllCategories() throws Exception { final Categories categories = this.mocker.getComponentUnderTest().getAllCategories(); final Collection<Category> categoryCollection = categories.getCategories(); Assert.assertEquals(3, categoryCollection.size()); Assert.assertEquals(Arrays.asList(this.categoryA, this.categoryB, this.categoryC), categoryCollection); }
@Override public Categories getAllCategories() { final Categories result = new Categories(); final List<String> categoryNames = this.vm.getAvailableCategories(); final List<Category> categories = this.objectFactory.createCategoriesRepresentation(categoryNames, getCategoryLinks(), this::getVocabulariesForCategory); result.withCategories(categories); result.withLinks(this.autolinker.get().forResource(getClass(), this.uriInfo).build()); return result; }
DefaultCategoriesResource extends XWikiResource implements CategoriesResource { @Override public Categories getAllCategories() { final Categories result = new Categories(); final List<String> categoryNames = this.vm.getAvailableCategories(); final List<Category> categories = this.objectFactory.createCategoriesRepresentation(categoryNames, getCategoryLinks(), this::getVocabulariesForCategory); result.withCategories(categories); result.withLinks(this.autolinker.get().forResource(getClass(), this.uriInfo).build()); return result; } }
DefaultCategoriesResource extends XWikiResource implements CategoriesResource { @Override public Categories getAllCategories() { final Categories result = new Categories(); final List<String> categoryNames = this.vm.getAvailableCategories(); final List<Category> categories = this.objectFactory.createCategoriesRepresentation(categoryNames, getCategoryLinks(), this::getVocabulariesForCategory); result.withCategories(categories); result.withLinks(this.autolinker.get().forResource(getClass(), this.uriInfo).build()); return result; }  }
DefaultCategoriesResource extends XWikiResource implements CategoriesResource { @Override public Categories getAllCategories() { final Categories result = new Categories(); final List<String> categoryNames = this.vm.getAvailableCategories(); final List<Category> categories = this.objectFactory.createCategoriesRepresentation(categoryNames, getCategoryLinks(), this::getVocabulariesForCategory); result.withCategories(categories); result.withLinks(this.autolinker.get().forResource(getClass(), this.uriInfo).build()); return result; }  @Override Categories getAllCategories(); }
DefaultCategoriesResource extends XWikiResource implements CategoriesResource { @Override public Categories getAllCategories() { final Categories result = new Categories(); final List<String> categoryNames = this.vm.getAvailableCategories(); final List<Category> categories = this.objectFactory.createCategoriesRepresentation(categoryNames, getCategoryLinks(), this::getVocabulariesForCategory); result.withCategories(categories); result.withLinks(this.autolinker.get().forResource(getClass(), this.uriInfo).build()); return result; }  @Override Categories getAllCategories();  }