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 testGetComment() 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);
  
              CloseableHttpResponse response = executeRequest(new HttpGet(
                              SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_HISTORIC_PROCESS_INSTANCE_COMMENT, pi.getId(), comment.getId())),
                      200);
  
              assertThat(response.getStatusLine().getStatusCode()).isEqualTo(HttpStatus.SC_OK);
  
              JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
              closeResponse(response);
              assertThat(responseNode).isNotNull();
              assertThatJson(responseNode)
                      .when(Option.IGNORING_EXTRA_FIELDS)
                      .isEqualTo(" {"
                              + "   id: '" + comment.getId() + "',"
                              + "   author: 'kermit',"
                              + "   message: 'This is a comment...',"
                              + "   taskId: null,"
                              + "   taskUrl: null,"
                              + "   processInstanceId: '" + pi.getProcessInstanceId() + "',"
                              + "   processInstanceUrl: '" + SERVER_URL_PREFIX + RestUrls
                              .createRelativeResourceUrl(RestUrls.URL_HISTORIC_PROCESS_INSTANCE_COMMENT, pi.getId(), comment.getId()) + "'"
                              + "}");
  
              // Test with unexisting process-instance
              closeResponse(executeRequest(new HttpGet(
                              SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_HISTORIC_PROCESS_INSTANCE_COMMENT, "unexistinginstance", "123")),
                      HttpStatus.SC_NOT_FOUND));
  
              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.testGetComment()
test_case.full_signature: @Test @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" }) public void testGetComment()
test_case.identifier: testGetComment
test_case.invocations: startProcessInstanceByKey setAuthenticatedUserId addComment getId setAuthenticatedUserId executeRequest createRelativeResourceUrl getId getId isEqualTo assertThat getStatusCode getStatusLine readTree getContent getEntity closeResponse isNotNull assertThat isEqualTo when assertThatJson getId getProcessInstanceId 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 testGetComment()
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 = "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) {
  
          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);
          }
  
          return restResponseFactory.createRestComment(comment);
      }
focal_method.class_method_signature: HistoricProcessInstanceCommentResource.getComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request)
focal_method.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_method.identifier: getComment
focal_method.invocations: getHistoricProcessInstanceFromRequest getComment getProcessInstanceId equals getProcessInstanceId getId getId createRestComment
focal_method.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_method.parameters: (@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request)
focal_method.return: CommentResponse
focal_method.signature: CommentResponse getComment(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "commentId") @PathVariable("commentId") String commentId, HttpServletRequest request)