@Test public void testBuildIndexYaml() throws Exception { List<Asset> list = Arrays.asList(asset); when(asset.formatAttributes()).thenReturn(formatAttributes); when(asset.attributes()).thenReturn(assetAttributes); when(asset.componentId()).thenReturn(entityId); Map<String, String> shaMap = new HashMap<>(); shaMap.put("sha256", "12345"); when(assetAttributes.get("checksum", Map.class)).thenReturn(shaMap); when(helmFacet.browseComponentAssets(storageTx, AssetKind.HELM_PACKAGE)).thenReturn(list); when(indexYamlBuilder.build(anyObject(), anyObject())).thenReturn(tempBlob); TempBlob result = underTest.buildIndexYaml(repository); assertThat(result, is(notNullValue())); }
@TransactionalStoreBlob @Nullable public TempBlob buildIndexYaml(final Repository repository) { StorageFacet storageFacet = repository.facet(StorageFacet.class); HelmFacet helmFacet = repository.facet(HelmFacet.class); StorageTx tx = UnitOfWork.currentTx(); ChartIndex index = new ChartIndex(); for (Asset asset : helmFacet.browseComponentAssets(tx, AssetKind.HELM_PACKAGE)) { parseAssetIntoChartEntry(index, asset); } index.setApiVersion(API_VERSION); index.setGenerated(new DateTime()); return indexYamlBuilder.build(index, storageFacet); }
CreateIndexServiceImpl extends ComponentSupport implements CreateIndexService { @TransactionalStoreBlob @Nullable public TempBlob buildIndexYaml(final Repository repository) { StorageFacet storageFacet = repository.facet(StorageFacet.class); HelmFacet helmFacet = repository.facet(HelmFacet.class); StorageTx tx = UnitOfWork.currentTx(); ChartIndex index = new ChartIndex(); for (Asset asset : helmFacet.browseComponentAssets(tx, AssetKind.HELM_PACKAGE)) { parseAssetIntoChartEntry(index, asset); } index.setApiVersion(API_VERSION); index.setGenerated(new DateTime()); return indexYamlBuilder.build(index, storageFacet); } }
CreateIndexServiceImpl extends ComponentSupport implements CreateIndexService { @TransactionalStoreBlob @Nullable public TempBlob buildIndexYaml(final Repository repository) { StorageFacet storageFacet = repository.facet(StorageFacet.class); HelmFacet helmFacet = repository.facet(HelmFacet.class); StorageTx tx = UnitOfWork.currentTx(); ChartIndex index = new ChartIndex(); for (Asset asset : helmFacet.browseComponentAssets(tx, AssetKind.HELM_PACKAGE)) { parseAssetIntoChartEntry(index, asset); } index.setApiVersion(API_VERSION); index.setGenerated(new DateTime()); return indexYamlBuilder.build(index, storageFacet); } @Inject  CreateIndexServiceImpl(final IndexYamlBuilder indexYamlBuilder); }
CreateIndexServiceImpl extends ComponentSupport implements CreateIndexService { @TransactionalStoreBlob @Nullable public TempBlob buildIndexYaml(final Repository repository) { StorageFacet storageFacet = repository.facet(StorageFacet.class); HelmFacet helmFacet = repository.facet(HelmFacet.class); StorageTx tx = UnitOfWork.currentTx(); ChartIndex index = new ChartIndex(); for (Asset asset : helmFacet.browseComponentAssets(tx, AssetKind.HELM_PACKAGE)) { parseAssetIntoChartEntry(index, asset); } index.setApiVersion(API_VERSION); index.setGenerated(new DateTime()); return indexYamlBuilder.build(index, storageFacet); } @Inject  CreateIndexServiceImpl(final IndexYamlBuilder indexYamlBuilder); @TransactionalStoreBlob @Nullable TempBlob buildIndexYaml(final Repository repository); }
CreateIndexServiceImpl extends ComponentSupport implements CreateIndexService { @TransactionalStoreBlob @Nullable public TempBlob buildIndexYaml(final Repository repository) { StorageFacet storageFacet = repository.facet(StorageFacet.class); HelmFacet helmFacet = repository.facet(HelmFacet.class); StorageTx tx = UnitOfWork.currentTx(); ChartIndex index = new ChartIndex(); for (Asset asset : helmFacet.browseComponentAssets(tx, AssetKind.HELM_PACKAGE)) { parseAssetIntoChartEntry(index, asset); } index.setApiVersion(API_VERSION); index.setGenerated(new DateTime()); return indexYamlBuilder.build(index, storageFacet); } @Inject  CreateIndexServiceImpl(final IndexYamlBuilder indexYamlBuilder); @TransactionalStoreBlob @Nullable TempBlob buildIndexYaml(final Repository repository);  }