@Test public void verifyAssetOverride() throws Exception { setupTest(COMPONENT_PATH); categories = featuredCategoryList.getCategories(); Assert.assertNotNull(categories); Assert.assertEquals(categories.get(1).getImage(), TEST_RENDITION_PATH); }
@Override public List<CategoryTree> getCategories() { if (categoriesRetriever == null) { return Collections.emptyList(); } List<CategoryTree> categories = categoriesRetriever.fetchCategories(); for (CategoryTree category : categories) { Map<String, String> params = new ParamsBuilder() .id(category.getId().toString()) .urlPath(category.getUrlPath()) .map(); category.setPath(urlProvider.toCategoryUrl(request, categoryPage, params)); String id = category.getId().toString(); if (assetOverride.containsKey(id)) { Asset asset = assetOverride.get(id); Rendition rendition = asset.getRendition(RENDITION_WEB); if (rendition == null) { rendition = asset.getRendition(RENDITION_ORIGINAL); } if (rendition != null) { category.setImage(rendition.getPath()); } } } return categories; }
FeaturedCategoryListImpl implements FeaturedCategoryList { @Override public List<CategoryTree> getCategories() { if (categoriesRetriever == null) { return Collections.emptyList(); } List<CategoryTree> categories = categoriesRetriever.fetchCategories(); for (CategoryTree category : categories) { Map<String, String> params = new ParamsBuilder() .id(category.getId().toString()) .urlPath(category.getUrlPath()) .map(); category.setPath(urlProvider.toCategoryUrl(request, categoryPage, params)); String id = category.getId().toString(); if (assetOverride.containsKey(id)) { Asset asset = assetOverride.get(id); Rendition rendition = asset.getRendition(RENDITION_WEB); if (rendition == null) { rendition = asset.getRendition(RENDITION_ORIGINAL); } if (rendition != null) { category.setImage(rendition.getPath()); } } } return categories; } }
FeaturedCategoryListImpl implements FeaturedCategoryList { @Override public List<CategoryTree> getCategories() { if (categoriesRetriever == null) { return Collections.emptyList(); } List<CategoryTree> categories = categoriesRetriever.fetchCategories(); for (CategoryTree category : categories) { Map<String, String> params = new ParamsBuilder() .id(category.getId().toString()) .urlPath(category.getUrlPath()) .map(); category.setPath(urlProvider.toCategoryUrl(request, categoryPage, params)); String id = category.getId().toString(); if (assetOverride.containsKey(id)) { Asset asset = assetOverride.get(id); Rendition rendition = asset.getRendition(RENDITION_WEB); if (rendition == null) { rendition = asset.getRendition(RENDITION_ORIGINAL); } if (rendition != null) { category.setImage(rendition.getPath()); } } } return categories; }  }
FeaturedCategoryListImpl implements FeaturedCategoryList { @Override public List<CategoryTree> getCategories() { if (categoriesRetriever == null) { return Collections.emptyList(); } List<CategoryTree> categories = categoriesRetriever.fetchCategories(); for (CategoryTree category : categories) { Map<String, String> params = new ParamsBuilder() .id(category.getId().toString()) .urlPath(category.getUrlPath()) .map(); category.setPath(urlProvider.toCategoryUrl(request, categoryPage, params)); String id = category.getId().toString(); if (assetOverride.containsKey(id)) { Asset asset = assetOverride.get(id); Rendition rendition = asset.getRendition(RENDITION_WEB); if (rendition == null) { rendition = asset.getRendition(RENDITION_ORIGINAL); } if (rendition != null) { category.setImage(rendition.getPath()); } } } return categories; }  @Override List<CategoryTree> getCategories(); @Override boolean isConfigured(); @Override AbstractCategoriesRetriever getCategoriesRetriever(); @Override String getTitleType(); }
FeaturedCategoryListImpl implements FeaturedCategoryList { @Override public List<CategoryTree> getCategories() { if (categoriesRetriever == null) { return Collections.emptyList(); } List<CategoryTree> categories = categoriesRetriever.fetchCategories(); for (CategoryTree category : categories) { Map<String, String> params = new ParamsBuilder() .id(category.getId().toString()) .urlPath(category.getUrlPath()) .map(); category.setPath(urlProvider.toCategoryUrl(request, categoryPage, params)); String id = category.getId().toString(); if (assetOverride.containsKey(id)) { Asset asset = assetOverride.get(id); Rendition rendition = asset.getRendition(RENDITION_WEB); if (rendition == null) { rendition = asset.getRendition(RENDITION_ORIGINAL); } if (rendition != null) { category.setImage(rendition.getPath()); } } } return categories; }  @Override List<CategoryTree> getCategories(); @Override boolean isConfigured(); @Override AbstractCategoriesRetriever getCategoriesRetriever(); @Override String getTitleType();  }