test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/history/HistoricProcessInstanceCommentResourceTest.java
test_class.identifier: HistoricProcessInstanceCommentResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" })
      public void testDeleteComment() throws Exception {
          ProcessInstance pi = null;
  
          try {
              pi = runtimeService.startProcessInstanceByKey("oneTaskProcess");
  
              // Add a comment as "kermit"
              identityService.setAuthenticatedUserId("kermit");
              Comment comment = taskService.addComment(null, pi.getId(), "This is a comment...");
              identityService.setAuthenticatedUserId(null);
  
              closeResponse(executeRequest(new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_HISTORIC_PROCESS_INSTANCE_COMMENT, pi.getId(), comment.getId())),
                      HttpStatus.SC_NO_CONTENT));
  
              // Test with unexisting instance
              closeResponse(executeRequest(new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_HISTORIC_PROCESS_INSTANCE_COMMENT, "unexistinginstance", "123")),
                      HttpStatus.SC_NOT_FOUND));
  
              // Test with unexisting comment
              closeResponse(executeRequest(new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_HISTORIC_PROCESS_INSTANCE_COMMENT, pi.getId(), "unexistingcomment")),
                      HttpStatus.SC_NOT_FOUND));
  
          } finally {
              if (pi != null) {
                  List<Comment> comments = taskService.getProcessInstanceComments(pi.getId());
                  for (Comment c : comments) {
                      taskService.deleteComment(c.getId());
                  }
              }
          }
      }
test_case.class_method_signature: HistoricProcessInstanceCommentResourceTest.testDeleteComment()
test_case.full_signature: @Test @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" }) public void testDeleteComment()
test_case.identifier: testDeleteComment
test_case.invocations: startProcessInstanceByKey setAuthenticatedUserId addComment getId setAuthenticatedUserId closeResponse executeRequest createRelativeResourceUrl getId getId closeResponse executeRequest createRelativeResourceUrl closeResponse executeRequest createRelativeResourceUrl getId getProcessInstanceComments getId deleteComment getId
test_case.modifiers: @Test @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" }) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDeleteComment()
focal_class.declarator: restResponseFactory
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected RestResponseFactory restResponseFactory;
focal_class.type: RestResponseFactory
focal_class.var_name: restResponseFactory
focal_class.declarator: historyService
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected HistoryService historyService;
focal_class.type: HistoryService
focal_class.var_name: historyService
focal_class.declarator: taskService
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected TaskService taskService;
focal_class.type: TaskService
focal_class.var_name: taskService
focal_class.file: modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceCommentResource.java
focal_class.identifier: HistoricProcessInstanceCommentResource
focal_class.class_method_signature: HistoricProcessInstanceCommentResource.getComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Get a comment on a historic process instance", tags = { "History Process" }, notes = "") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the historic process instance and comment were found and the comment is returned."), @ApiResponse(code = 404, message = "Indicates the requested historic process instance was not found or the historic process instance does not have a comment with the given ID.") }) @GetMapping(value = "/history/historic-process-instances/{processInstanceId}/comments/{commentId}", produces = "application/json") public CommentResponse getComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request)
focal_class.identifier: getComment
focal_class.modifiers: @ApiOperation(value = "Get a comment on a historic process instance", tags = { "History Process" }, notes = "") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the historic process instance and comment were found and the comment is returned."), @ApiResponse(code = 404, message = "Indicates the requested historic process instance was not found or the historic process instance does not have a comment with the given ID.") }) @GetMapping(value = "/history/historic-process-instances/{processInstanceId}/comments/{commentId}", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request)
focal_class.return: CommentResponse
focal_class.signature: CommentResponse getComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request)
focal_class.class_method_signature: HistoricProcessInstanceCommentResource.deleteComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request,
              HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = "Delete a comment on a historic process instance", tags = { "History Process" }, notes = "") @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the historic process instance and comment were found and the comment is deleted. Response body is left empty intentionally."), @ApiResponse(code = 404, message = "Indicates the requested historic process instance was not found or the historic process instance does not have a comment with the given ID.") }) @DeleteMapping(value = "/history/historic-process-instances/{processInstanceId}/comments/{commentId}") public void deleteComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request,
              HttpServletResponse response)
focal_class.identifier: deleteComment
focal_class.modifiers: @ApiOperation(value = "Delete a comment on a historic process instance", tags = { "History Process" }, notes = "") @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the historic process instance and comment were found and the comment is deleted. Response body is left empty intentionally."), @ApiResponse(code = 404, message = "Indicates the requested historic process instance was not found or the historic process instance does not have a comment with the given ID.") }) @DeleteMapping(value = "/history/historic-process-instances/{processInstanceId}/comments/{commentId}") public
focal_class.parameters: (@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request,
              HttpServletResponse response)
focal_class.return: void
focal_class.signature: void deleteComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request,
              HttpServletResponse response)
focal_class.superclass: extends HistoricProcessInstanceBaseResource
focal_method.body: @ApiOperation(value = "Delete a comment on a historic process instance", tags = { "History Process" }, notes = "")
      @ApiResponses(value = {
              @ApiResponse(code = 204, message = "Indicates the historic process instance and comment were found and the comment is deleted. Response body is left empty intentionally."),
              @ApiResponse(code = 404, message = "Indicates the requested historic process instance was not found or the historic process instance does not have a comment with the given ID.") })
      @DeleteMapping(value = "/history/historic-process-instances/{processInstanceId}/comments/{commentId}")
      public void deleteComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request,
              HttpServletResponse response) {
  
          HistoricProcessInstance instance = getHistoricProcessInstanceFromRequest(processInstanceId);
  
          Comment comment = taskService.getComment(commentId);
          if (comment == null || comment.getProcessInstanceId() == null || !comment.getProcessInstanceId().equals(instance.getId())) {
              throw new FlowableObjectNotFoundException("Process instance '" + instance.getId() + "' does not have a comment with id '" + commentId + "'.", Comment.class);
          }
  
          taskService.deleteComment(commentId);
          response.setStatus(HttpStatus.NO_CONTENT.value());
      }
focal_method.class_method_signature: HistoricProcessInstanceCommentResource.deleteComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request,
              HttpServletResponse response)
focal_method.full_signature: @ApiOperation(value = "Delete a comment on a historic process instance", tags = { "History Process" }, notes = "") @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the historic process instance and comment were found and the comment is deleted. Response body is left empty intentionally."), @ApiResponse(code = 404, message = "Indicates the requested historic process instance was not found or the historic process instance does not have a comment with the given ID.") }) @DeleteMapping(value = "/history/historic-process-instances/{processInstanceId}/comments/{commentId}") public void deleteComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request,
              HttpServletResponse response)
focal_method.identifier: deleteComment
focal_method.invocations: getHistoricProcessInstanceFromRequest getComment getProcessInstanceId equals getProcessInstanceId getId getId deleteComment setStatus value
focal_method.modifiers: @ApiOperation(value = "Delete a comment on a historic process instance", tags = { "History Process" }, notes = "") @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the historic process instance and comment were found and the comment is deleted. Response body is left empty intentionally."), @ApiResponse(code = 404, message = "Indicates the requested historic process instance was not found or the historic process instance does not have a comment with the given ID.") }) @DeleteMapping(value = "/history/historic-process-instances/{processInstanceId}/comments/{commentId}") public
focal_method.parameters: (@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request,
              HttpServletResponse response)
focal_method.return: void
focal_method.signature: void deleteComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request,
              HttpServletResponse response)