@Test public void should_build_paths_to_base_versioned_component() { AssetData asset = new AssetData(); asset.setComponent(aReleaseVersionedComponent()); List<BrowsePath> browsePaths = underTest.computeComponentPaths(asset); assertThat(browsePaths.size(), is(4)); assertThat(browsePaths, containsInAnyOrder( new BrowsePath("org", "/org/"), new BrowsePath("hamcrest", "/org/hamcrest/"), new BrowsePath("hamcrest-core", "/org/hamcrest/hamcrest-core/"), new BrowsePath(BASE_VERSION, "/org/hamcrest/hamcrest-core/1.3/"))); }
@Override public List<BrowsePath> computeComponentPaths(final Asset asset) { checkNotNull(asset); Component component = asset.component().get(); List<String> componentPath = pathToArtifactFolder(component); String version = component.version(); if (!isBlank(version) && !version.equals(componentPath.get(componentPath.size() - 1))) { componentPath.add(version); } return fromPaths(componentPath, true); }
Maven2BrowseNodeGenerator extends ComponentPathBrowseNodeGenerator { @Override public List<BrowsePath> computeComponentPaths(final Asset asset) { checkNotNull(asset); Component component = asset.component().get(); List<String> componentPath = pathToArtifactFolder(component); String version = component.version(); if (!isBlank(version) && !version.equals(componentPath.get(componentPath.size() - 1))) { componentPath.add(version); } return fromPaths(componentPath, true); } }
Maven2BrowseNodeGenerator extends ComponentPathBrowseNodeGenerator { @Override public List<BrowsePath> computeComponentPaths(final Asset asset) { checkNotNull(asset); Component component = asset.component().get(); List<String> componentPath = pathToArtifactFolder(component); String version = component.version(); if (!isBlank(version) && !version.equals(componentPath.get(componentPath.size() - 1))) { componentPath.add(version); } return fromPaths(componentPath, true); }  }
Maven2BrowseNodeGenerator extends ComponentPathBrowseNodeGenerator { @Override public List<BrowsePath> computeComponentPaths(final Asset asset) { checkNotNull(asset); Component component = asset.component().get(); List<String> componentPath = pathToArtifactFolder(component); String version = component.version(); if (!isBlank(version) && !version.equals(componentPath.get(componentPath.size() - 1))) { componentPath.add(version); } return fromPaths(componentPath, true); }  @Override List<BrowsePath> computeAssetPaths(final Asset asset); @Override List<BrowsePath> computeComponentPaths(final Asset asset); }
Maven2BrowseNodeGenerator extends ComponentPathBrowseNodeGenerator { @Override public List<BrowsePath> computeComponentPaths(final Asset asset) { checkNotNull(asset); Component component = asset.component().get(); List<String> componentPath = pathToArtifactFolder(component); String version = component.version(); if (!isBlank(version) && !version.equals(componentPath.get(componentPath.size() - 1))) { componentPath.add(version); } return fromPaths(componentPath, true); }  @Override List<BrowsePath> computeAssetPaths(final Asset asset); @Override List<BrowsePath> computeComponentPaths(final Asset asset);  }