@Test public void testProductPageWithoutIdentifier() throws Exception { prepareModel("/content/venia/us/en/products/product-page"); breadcrumbModel = context.request().adaptTo(BreadcrumbImpl.class); List<NavigationItem> items = (List<NavigationItem>) breadcrumbModel.getItems(); assertThat(items.stream().map(i -> i.getTitle())).containsExactly("en"); }
@Override public Collection<NavigationItem> getItems() { if (!currentPage.getPath().startsWith("/content")) { return Collections.emptyList(); } if (items == null) { items = new ArrayList<>(); Collection<NavigationItem> pageItems = breadcrumb.getItems(); pageItems.forEach(item -> populateItems(item)); } return Collections.unmodifiableList(items); }
BreadcrumbImpl implements Breadcrumb { @Override public Collection<NavigationItem> getItems() { if (!currentPage.getPath().startsWith("/content")) { return Collections.emptyList(); } if (items == null) { items = new ArrayList<>(); Collection<NavigationItem> pageItems = breadcrumb.getItems(); pageItems.forEach(item -> populateItems(item)); } return Collections.unmodifiableList(items); } }
BreadcrumbImpl implements Breadcrumb { @Override public Collection<NavigationItem> getItems() { if (!currentPage.getPath().startsWith("/content")) { return Collections.emptyList(); } if (items == null) { items = new ArrayList<>(); Collection<NavigationItem> pageItems = breadcrumb.getItems(); pageItems.forEach(item -> populateItems(item)); } return Collections.unmodifiableList(items); }  }
BreadcrumbImpl implements Breadcrumb { @Override public Collection<NavigationItem> getItems() { if (!currentPage.getPath().startsWith("/content")) { return Collections.emptyList(); } if (items == null) { items = new ArrayList<>(); Collection<NavigationItem> pageItems = breadcrumb.getItems(); pageItems.forEach(item -> populateItems(item)); } return Collections.unmodifiableList(items); }  @Override Collection<NavigationItem> getItems(); @Override Comparator<CategoryInterface> getCategoryInterfaceComparator(); }
BreadcrumbImpl implements Breadcrumb { @Override public Collection<NavigationItem> getItems() { if (!currentPage.getPath().startsWith("/content")) { return Collections.emptyList(); } if (items == null) { items = new ArrayList<>(); Collection<NavigationItem> pageItems = breadcrumb.getItems(); pageItems.forEach(item -> populateItems(item)); } return Collections.unmodifiableList(items); }  @Override Collection<NavigationItem> getItems(); @Override Comparator<CategoryInterface> getCategoryInterfaceComparator();  }