@Test public void testDeleteApplication() throws Exception { Response response = this.resource.deleteApplication("myApplicationA"); Assert.assertEquals(response.getStatus(), 200); Assert.assertEquals(this.appDAO.findAll().size(), 1); Assert.assertEquals(this.detectionAlertDAO.findAll().size(), 1); Assert.assertEquals(this.functionDAO.findAll().size(), 1); Assert.assertEquals(this.anomalyDAO.findAll().size(), 2); }
@DELETE @Path("/delete/{name}") @ApiOperation(value = "Delete an application along with associated subscriptions, functions and anomalies") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response deleteApplication( @ApiParam(value = "Name of the application") @PathParam("name") final String name ) { final ApplicationDTO application = getByName(name); LOG.debug("[APPLICATION] deleting application " + name); deleteDependents(name); applicationManager.delete(application); LOG.info("[APPLICATION] Successfully deleted application " + name); Map<String, String> responseMessage = new HashMap<>(); responseMessage.put("message", "Successfully deleted application."); return Response.ok().entity(responseMessage).build(); }
ApplicationResource { @DELETE @Path("/delete/{name}") @ApiOperation(value = "Delete an application along with associated subscriptions, functions and anomalies") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response deleteApplication( @ApiParam(value = "Name of the application") @PathParam("name") final String name ) { final ApplicationDTO application = getByName(name); LOG.debug("[APPLICATION] deleting application " + name); deleteDependents(name); applicationManager.delete(application); LOG.info("[APPLICATION] Successfully deleted application " + name); Map<String, String> responseMessage = new HashMap<>(); responseMessage.put("message", "Successfully deleted application."); return Response.ok().entity(responseMessage).build(); } }
ApplicationResource { @DELETE @Path("/delete/{name}") @ApiOperation(value = "Delete an application along with associated subscriptions, functions and anomalies") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response deleteApplication( @ApiParam(value = "Name of the application") @PathParam("name") final String name ) { final ApplicationDTO application = getByName(name); LOG.debug("[APPLICATION] deleting application " + name); deleteDependents(name); applicationManager.delete(application); LOG.info("[APPLICATION] Successfully deleted application " + name); Map<String, String> responseMessage = new HashMap<>(); responseMessage.put("message", "Successfully deleted application."); return Response.ok().entity(responseMessage).build(); } @Inject  ApplicationResource(
      ApplicationManager applicationManager,
      MergedAnomalyResultManager mergedAnomalyResultManager,
      DetectionConfigManager detectionConfigManager,
      DetectionAlertConfigManager detectionAlertConfigManager); }
ApplicationResource { @DELETE @Path("/delete/{name}") @ApiOperation(value = "Delete an application along with associated subscriptions, functions and anomalies") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response deleteApplication( @ApiParam(value = "Name of the application") @PathParam("name") final String name ) { final ApplicationDTO application = getByName(name); LOG.debug("[APPLICATION] deleting application " + name); deleteDependents(name); applicationManager.delete(application); LOG.info("[APPLICATION] Successfully deleted application " + name); Map<String, String> responseMessage = new HashMap<>(); responseMessage.put("message", "Successfully deleted application."); return Response.ok().entity(responseMessage).build(); } @Inject  ApplicationResource(
      ApplicationManager applicationManager,
      MergedAnomalyResultManager mergedAnomalyResultManager,
      DetectionConfigManager detectionConfigManager,
      DetectionAlertConfigManager detectionAlertConfigManager); @POST @Path("reset/{name}") Response reset(
      @ApiParam(value = "Name of the application") @PathParam("name") String name
  ); @DELETE @Path("/delete/{name}") @ApiOperation(value = "Delete an application along with associated subscriptions, functions and anomalies") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response deleteApplication(
      @ApiParam(value = "Name of the application") @PathParam("name") final String name
  ); }
ApplicationResource { @DELETE @Path("/delete/{name}") @ApiOperation(value = "Delete an application along with associated subscriptions, functions and anomalies") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response deleteApplication( @ApiParam(value = "Name of the application") @PathParam("name") final String name ) { final ApplicationDTO application = getByName(name); LOG.debug("[APPLICATION] deleting application " + name); deleteDependents(name); applicationManager.delete(application); LOG.info("[APPLICATION] Successfully deleted application " + name); Map<String, String> responseMessage = new HashMap<>(); responseMessage.put("message", "Successfully deleted application."); return Response.ok().entity(responseMessage).build(); } @Inject  ApplicationResource(
      ApplicationManager applicationManager,
      MergedAnomalyResultManager mergedAnomalyResultManager,
      DetectionConfigManager detectionConfigManager,
      DetectionAlertConfigManager detectionAlertConfigManager); @POST @Path("reset/{name}") Response reset(
      @ApiParam(value = "Name of the application") @PathParam("name") String name
  ); @DELETE @Path("/delete/{name}") @ApiOperation(value = "Delete an application along with associated subscriptions, functions and anomalies") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response deleteApplication(
      @ApiParam(value = "Name of the application") @PathParam("name") final String name
  );  }