@Test public void nullWhenAssetNullOnGetContent() throws Exception { when(storageTx.findAssetWithProperty(anyString(), anyString(), any(Bucket.class))).thenReturn(null); Content archive = underTest.getStoredContent(PACKAGES_GZ_PATH); assertThat(archive, is(nullValue())); }
@Override @TransactionalTouchBlob public Content getStoredContent(final String contentPath) { checkNotNull(contentPath); StorageTx tx = UnitOfWork.currentTx(); Asset asset = findAsset(tx, tx.findBucket(getRepository()), contentPath); if (asset == null) { return null; } if (asset.markAsDownloaded()) { tx.saveAsset(asset); } return toContent(asset, tx.requireBlob(asset.requireBlobRef())); }
RHostedFacetImpl extends FacetSupport implements RHostedFacet { @Override @TransactionalTouchBlob public Content getStoredContent(final String contentPath) { checkNotNull(contentPath); StorageTx tx = UnitOfWork.currentTx(); Asset asset = findAsset(tx, tx.findBucket(getRepository()), contentPath); if (asset == null) { return null; } if (asset.markAsDownloaded()) { tx.saveAsset(asset); } return toContent(asset, tx.requireBlob(asset.requireBlobRef())); } }
RHostedFacetImpl extends FacetSupport implements RHostedFacet { @Override @TransactionalTouchBlob public Content getStoredContent(final String contentPath) { checkNotNull(contentPath); StorageTx tx = UnitOfWork.currentTx(); Asset asset = findAsset(tx, tx.findBucket(getRepository()), contentPath); if (asset == null) { return null; } if (asset.markAsDownloaded()) { tx.saveAsset(asset); } return toContent(asset, tx.requireBlob(asset.requireBlobRef())); }  }
RHostedFacetImpl extends FacetSupport implements RHostedFacet { @Override @TransactionalTouchBlob public Content getStoredContent(final String contentPath) { checkNotNull(contentPath); StorageTx tx = UnitOfWork.currentTx(); Asset asset = findAsset(tx, tx.findBucket(getRepository()), contentPath); if (asset == null) { return null; } if (asset.markAsDownloaded()) { tx.saveAsset(asset); } return toContent(asset, tx.requireBlob(asset.requireBlobRef())); }  @Override @TransactionalTouchBlob Content getStoredContent(final String contentPath); @Override Asset upload(final String path, final Payload payload); @Override @TransactionalTouchMetadata Content buildAndPutPackagesGz(final String basePath); }
RHostedFacetImpl extends FacetSupport implements RHostedFacet { @Override @TransactionalTouchBlob public Content getStoredContent(final String contentPath) { checkNotNull(contentPath); StorageTx tx = UnitOfWork.currentTx(); Asset asset = findAsset(tx, tx.findBucket(getRepository()), contentPath); if (asset == null) { return null; } if (asset.markAsDownloaded()) { tx.saveAsset(asset); } return toContent(asset, tx.requireBlob(asset.requireBlobRef())); }  @Override @TransactionalTouchBlob Content getStoredContent(final String contentPath); @Override Asset upload(final String path, final Payload payload); @Override @TransactionalTouchMetadata Content buildAndPutPackagesGz(final String basePath);  }