NpmFacetImpl extends FacetSupport implements NpmFacet { @Nullable @Override public Asset putPackageRoot(final String packageId, final AssetBlob assetBlob, @Nullable final AttributesMap contentAttributes) throws IOException { final Repository repository = getRepository(); final StorageTx tx = UnitOfWork.currentTx(); final Bucket bucket = tx.findBucket(repository); Asset asset = NpmFacetUtils.findPackageRootAsset(tx, bucket, NpmPackageId.parse(packageId)); if (asset == null) { asset = tx.createAsset(bucket, repository.getFormat()).name(packageId); saveAsset(tx, asset, assetBlob, PACKAGE_ROOT, contentAttributes); } return asset; } @Inject  NpmFacetImpl(final NpmPackageParser npmPackageParser); @Nullable @Override Asset findRepositoryRootAsset(); @Nullable @Override Asset putRepositoryRoot(final AssetBlob assetBlob, @Nullable final AttributesMap contentAttributes); @Nullable @Override Asset findPackageRootAsset(final String packageId); @Nullable @Override Asset putPackageRoot(final String packageId,
                              final AssetBlob assetBlob,
                              @Nullable final AttributesMap contentAttributes); @Nullable @Override Asset findTarballAsset(final String packageId,
                                final String tarballName); @Nullable @Override Asset putTarball(final String packageId,
                          final String tarballName,
                          final AssetBlob assetBlob,
                          @Nullable final AttributesMap contentAttributes);  }
@Test public void testPutPackageRoot() throws Exception { underTest.putPackageRoot(packageId.id(), assetBlob, null); verifyAssetCreated(packageId.id()); }