@Test public void createFromAssetSavesNodesForFormatSpecificAssetWithComponent() { List<BrowsePaths> assetPath = toBrowsePaths(asList("component", "asset")); Component component = createComponent("component", null, null, "componentId"); Asset asset = createAsset("asset", "assetId", MAVEN_2, EntityHelper.id(component)); when(maven2BrowseNodeGenerator.computeAssetPaths(asset, component)).thenReturn(assetPath); when(maven2BrowseNodeGenerator.computeComponentPaths(asset, component)).thenReturn(assetPath.subList(0, 1)); manager.createFromAsset(REPOSITORY_NAME, asset); verify(browseNodeStore) .createComponentNode(REPOSITORY_NAME, MAVEN_2, toBrowsePaths(singletonList(component.name())), component); verify(browseNodeStore) .createAssetNode(REPOSITORY_NAME, MAVEN_2, toBrowsePaths(asList(component.name(), asset.name())), asset); verifyNoMoreInteractions(browseNodeStore); }
public void createFromAsset(final String repositoryName, final Asset asset) { checkNotNull(repositoryName); checkNotNull(asset); BrowseNodeGenerator generator = pathGenerators.getOrDefault(asset.format(), defaultGenerator); createBrowseNodes(repositoryName, asset.format(), generator, asset); }
OrientBrowseNodeManager extends ComponentSupport { public void createFromAsset(final String repositoryName, final Asset asset) { checkNotNull(repositoryName); checkNotNull(asset); BrowseNodeGenerator generator = pathGenerators.getOrDefault(asset.format(), defaultGenerator); createBrowseNodes(repositoryName, asset.format(), generator, asset); } }
OrientBrowseNodeManager extends ComponentSupport { public void createFromAsset(final String repositoryName, final Asset asset) { checkNotNull(repositoryName); checkNotNull(asset); BrowseNodeGenerator generator = pathGenerators.getOrDefault(asset.format(), defaultGenerator); createBrowseNodes(repositoryName, asset.format(), generator, asset); } @Inject  OrientBrowseNodeManager(
      final OrientBrowseNodeStore browseNodeStore,
      final ComponentStore componentStore,
      final Map<String, BrowseNodeGenerator> pathGenerators); }
OrientBrowseNodeManager extends ComponentSupport { public void createFromAsset(final String repositoryName, final Asset asset) { checkNotNull(repositoryName); checkNotNull(asset); BrowseNodeGenerator generator = pathGenerators.getOrDefault(asset.format(), defaultGenerator); createBrowseNodes(repositoryName, asset.format(), generator, asset); } @Inject  OrientBrowseNodeManager(
      final OrientBrowseNodeStore browseNodeStore,
      final ComponentStore componentStore,
      final Map<String, BrowseNodeGenerator> pathGenerators); void createFromAsset(final String repositoryName, final Asset asset); void maybeCreateFromUpdatedAsset(final String repositoryName, final EntityId assetId, final Asset asset); void createFromAssets(final Repository repository, final Iterable<Asset> assets); void deleteAssetNode(final Asset asset); void deleteComponentNode(final Component component); void deleteByRepository(final String repositoryName); }
OrientBrowseNodeManager extends ComponentSupport { public void createFromAsset(final String repositoryName, final Asset asset) { checkNotNull(repositoryName); checkNotNull(asset); BrowseNodeGenerator generator = pathGenerators.getOrDefault(asset.format(), defaultGenerator); createBrowseNodes(repositoryName, asset.format(), generator, asset); } @Inject  OrientBrowseNodeManager(
      final OrientBrowseNodeStore browseNodeStore,
      final ComponentStore componentStore,
      final Map<String, BrowseNodeGenerator> pathGenerators); void createFromAsset(final String repositoryName, final Asset asset); void maybeCreateFromUpdatedAsset(final String repositoryName, final EntityId assetId, final Asset asset); void createFromAssets(final Repository repository, final Iterable<Asset> assets); void deleteAssetNode(final Asset asset); void deleteComponentNode(final Component component); void deleteByRepository(final String repositoryName);  }