AssetsResource extends ComponentSupport implements Resource, AssetsResourceDoc { @DELETE @Path("/{id}") public void deleteAsset(@PathParam("id") final String id) { RepositoryItemIDXO repositoryItemIDXO = fromString(id); Repository repository = repositoryManagerRESTAdapter.getRepository(repositoryItemIDXO.getRepositoryId()); DetachedEntityId entityId = new DetachedEntityId(repositoryItemIDXO.getId()); Asset asset = getAsset(id, repository, entityId); if (repository != null && asset != null) { maintenanceService.deleteAsset(repository, asset); } } @Inject  AssetsResource(final BrowseService browseService,
                        final RepositoryManagerRESTAdapter repositoryManagerRESTAdapter,
                        final AssetEntityAdapter assetEntityAdapter,
                        final MaintenanceService maintenanceService,
                        @Named("asset") final ContinuationTokenHelper continuationTokenHelper); @GET Page<AssetXO> getAssets(@QueryParam("continuationToken") final String continuationToken,
      @QueryParam("repository") final String repositoryId); @GET @Path("/{id}") AssetXO getAssetById(@PathParam("id") final String id); @DELETE @Path("/{id}") void deleteAsset(@PathParam("id")
                          final String id); static final String RESOURCE_URI; }
@Test public void testDeleteAsset() { RepositoryItemIDXO repositoryItemIDXO = new RepositoryItemIDXO("maven-releases", "c0ac2ab6c5e93a4a3909f0830fdadfcd"); DetachedEntityId entityId = new DetachedEntityId(repositoryItemIDXO.getId()); when(assetEntityAdapter.recordIdentity(entityId)).thenReturn(assetOneORID); when(browseService.getAssetById(assetOneORID, mavenReleases)).thenReturn(assetOne); underTest.deleteAsset(repositoryItemIDXO.getValue()); verify(maintenanceService).deleteAsset(mavenReleases, assetOne); }