TargetResource implements ITargetResource { @Override public Response deleteTarget( String targetId ) { this.logger.fine( "Request: delete target " + targetId + "." ); Response response = Response.ok().build(); try { this.manager.targetsMngr().deleteTarget( targetId ); } catch( IOException | UnauthorizedActionException e ) { Status status = this.exceptionclassToErrorCode.get( e.getClass()); response = handleError( status, new RestError( ErrorCode.REST_DELETION_ERROR, e, ErrorDetails.name( targetId )), lang( this.manager )).build(); } return response; } TargetResource( Manager manager ); @Override List<TargetWrapperDescriptor> listTargets( String name, String qualifier ); @Override Response createOrUpdateTarget( String rawProperties, String targetId ); @Override Response loadTargetArchive( InputStream uploadedInputStream, FormDataContentDisposition fileDetail ); @Override Response deleteTarget( String targetId ); @Override Response getTargetProperties( String targetId ); @Override Response findTargetById( String targetId ); @Override Response associateTarget(
			String name,
			String qualifier,
			String instancePathOrComponentName,
			String targetId,
			boolean bind ); @Override Response updateHint( String name, String qualifier, String targetId, boolean bind ); @Override List<TargetUsageItem> findUsageStatistics( String targetId );  }
@Test public void testDeleteTarget_inexistingTarget() throws Exception { Response resp = this.resource.deleteTarget( "oops" ); Assert.assertEquals( Status.OK.getStatusCode(), resp.getStatus()); }