ComponentsResource extends ComponentSupport implements Resource, ComponentsResourceDoc { @Override @DELETE @Path("/{id}") public void deleteComponent(@PathParam("id") final String id) { RepositoryItemIDXO repositoryItemIdXO = fromString(id); Repository repository = repositoryManagerRESTAdapter.getRepository(repositoryItemIdXO.getRepositoryId()); Component component = getComponent(repositoryItemIdXO, repository); if (repository != null && component != null) { maintenanceService.deleteComponent(repository, component); } } @Inject  ComponentsResource(final RepositoryManagerRESTAdapter repositoryManagerRESTAdapter,
                            final BrowseService browseService,
                            final ComponentEntityAdapter componentEntityAdapter,
                            final MaintenanceService maintenanceService,
                            @Named("component") final ContinuationTokenHelper continuationTokenHelper,
                            final UploadManager uploadManager,
                            final UploadConfiguration uploadConfiguration,
                            final ComponentXOFactory componentXOFactory,
                            final Set<ComponentsResourceExtension> componentsResourceExtensions); @Override @GET Page<ComponentXO> getComponents(@QueryParam("continuationToken") final String continuationToken,
                                         @QueryParam("repository") final String repositoryId); @Override @GET @Path("/{id}") ComponentXO getComponentById(@PathParam("id") final String id); @Override @DELETE @Path("/{id}") void deleteComponent(@PathParam("id") final String id); @Override @POST @Consumes(MediaType.MULTIPART_FORM_DATA) void uploadComponent(@QueryParam("repository") final String repositoryId,
                              @Context final HttpServletRequest request); static final String RESOURCE_URI; }
@Test public void deleteComponent() throws Exception { RepositoryItemIDXO repositoryItemXOID = getRepositoryItemIdXO(componentOne); underTest.deleteComponent(repositoryItemXOID.getValue()); verify(maintenanceService).deleteComponent(mavenReleases, componentOne); }
@Test(expected = NotFoundException.class) public void deleteComponent_notFound() throws Exception { RepositoryItemIDXO repositoryItemXOID = getRepositoryItemIdXO(null); underTest.deleteComponent(repositoryItemXOID.getValue()); }