test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/management/JobExceptionStacktraceResourceTest.java
test_class.identifier: JobExceptionStacktraceResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      @Deployment(resources = { "org/flowable/rest/service/api/management/JobExceptionStacktraceResourceTest.testTimerProcess.bpmn20.xml" })
      public void testGetJobStacktrace() throws Exception {
          // Start process, forcing error on job-execution
          ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("timerProcess", Collections.singletonMap("error", (Object) Boolean.TRUE));
  
          Job timerJob = managementService.createTimerJobQuery().processInstanceId(processInstance.getId()).singleResult();
          assertThat(timerJob).isNotNull();
  
          // Force execution of job
          Job timerJob2 = managementService.createTimerJobQuery().processInstanceId(processInstance.getId()).timers().singleResult();
          assertThatThrownBy(() -> {
              managementService.moveTimerToExecutableJob(timerJob2.getId());
              managementService.executeJob(timerJob2.getId());
          })
                  .isExactlyInstanceOf(FlowableException.class);
  
          Calendar now = Calendar.getInstance();
          now.set(Calendar.MILLISECOND, 0);
          processEngineConfiguration.getClock().setCurrentTime(now.getTime());
  
          CloseableHttpResponse response = executeRequest(new HttpGet(
                  SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_TIMER_JOB_EXCEPTION_STRACKTRACE, timerJob.getId())), HttpStatus.SC_OK);
  
          String stack = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
          assertThat(stack).isNotNull();
          assertThat(stack).isEqualTo(managementService.getTimerJobExceptionStacktrace(timerJob.getId()));
  
          // Also check content-type
          assertThat(response.getEntity().getContentType().getValue()).isEqualTo("text/plain");
          closeResponse(response);
      }
test_case.class_method_signature: JobExceptionStacktraceResourceTest.testGetJobStacktrace()
test_case.full_signature: @Test @Deployment(resources = { "org/flowable/rest/service/api/management/JobExceptionStacktraceResourceTest.testTimerProcess.bpmn20.xml" }) public void testGetJobStacktrace()
test_case.identifier: testGetJobStacktrace
test_case.invocations: startProcessInstanceByKey singletonMap singleResult processInstanceId createTimerJobQuery getId isNotNull assertThat singleResult timers processInstanceId createTimerJobQuery getId isExactlyInstanceOf assertThatThrownBy moveTimerToExecutableJob getId executeJob getId getInstance set setCurrentTime getClock getTime executeRequest createRelativeResourceUrl getId toString getContent getEntity isNotNull assertThat isEqualTo assertThat getTimerJobExceptionStacktrace getId isEqualTo assertThat getValue getContentType getEntity closeResponse
test_case.modifiers: @Test @Deployment(resources = { "org/flowable/rest/service/api/management/JobExceptionStacktraceResourceTest.testTimerProcess.bpmn20.xml" }) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetJobStacktrace()
focal_class.file: modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/JobExceptionStacktraceResource.java
focal_class.identifier: JobExceptionStacktraceResource
focal_class.class_method_signature: JobExceptionStacktraceResource.getJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = "Get the exception stacktrace for a job", tags = { "Jobs" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.") }) @GetMapping("/management/jobs/{jobId}/exception-stacktrace") public String getJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.identifier: getJobStacktrace
focal_class.modifiers: @ApiOperation(value = "Get the exception stacktrace for a job", tags = { "Jobs" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.") }) @GetMapping("/management/jobs/{jobId}/exception-stacktrace") public
focal_class.parameters: (@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.return: String
focal_class.signature: String getJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.class_method_signature: JobExceptionStacktraceResource.getTimerJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = "Get the exception stacktrace for a timer job", tags = { "Jobs" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.") }) @GetMapping("/management/timer-jobs/{jobId}/exception-stacktrace") public String getTimerJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.identifier: getTimerJobStacktrace
focal_class.modifiers: @ApiOperation(value = "Get the exception stacktrace for a timer job", tags = { "Jobs" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.") }) @GetMapping("/management/timer-jobs/{jobId}/exception-stacktrace") public
focal_class.parameters: (@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.return: String
focal_class.signature: String getTimerJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.class_method_signature: JobExceptionStacktraceResource.getSuspendedJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = "Get the exception stacktrace for a suspended job", tags = { "Jobs" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.") }) @GetMapping("/management/suspended-jobs/{jobId}/exception-stacktrace") public String getSuspendedJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.identifier: getSuspendedJobStacktrace
focal_class.modifiers: @ApiOperation(value = "Get the exception stacktrace for a suspended job", tags = { "Jobs" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.") }) @GetMapping("/management/suspended-jobs/{jobId}/exception-stacktrace") public
focal_class.parameters: (@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.return: String
focal_class.signature: String getSuspendedJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.class_method_signature: JobExceptionStacktraceResource.getDeadLetterJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = "Get the exception stacktrace for a deadletter job", tags = { "Jobs" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.") }) @GetMapping("/management/deadletter-jobs/{jobId}/exception-stacktrace") public String getDeadLetterJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.identifier: getDeadLetterJobStacktrace
focal_class.modifiers: @ApiOperation(value = "Get the exception stacktrace for a deadletter job", tags = { "Jobs" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.") }) @GetMapping("/management/deadletter-jobs/{jobId}/exception-stacktrace") public
focal_class.parameters: (@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.return: String
focal_class.signature: String getDeadLetterJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_class.superclass: extends JobBaseResource
focal_method.body: @ApiOperation(value = "Get the exception stacktrace for a job", tags = { "Jobs" })
      @ApiResponses(value = {
              @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."),
              @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.")
      })
      @GetMapping("/management/jobs/{jobId}/exception-stacktrace")
      public String getJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response) {
          Job job = getJobById(jobId);
  
          String stackTrace = managementService.getJobExceptionStacktrace(job.getId());
  
          if (stackTrace == null) {
              throw new FlowableObjectNotFoundException("Job with id '" + job.getId() + "' does not have an exception stacktrace.", String.class);
          }
  
          response.setContentType("text/plain");
          return stackTrace;
      }
focal_method.class_method_signature: JobExceptionStacktraceResource.getJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_method.full_signature: @ApiOperation(value = "Get the exception stacktrace for a job", tags = { "Jobs" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.") }) @GetMapping("/management/jobs/{jobId}/exception-stacktrace") public String getJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_method.identifier: getJobStacktrace
focal_method.invocations: getJobById getJobExceptionStacktrace getId getId setContentType
focal_method.modifiers: @ApiOperation(value = "Get the exception stacktrace for a job", tags = { "Jobs" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."), @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job does not have an exception stacktrace. Status-description contains additional information about the error.") }) @GetMapping("/management/jobs/{jobId}/exception-stacktrace") public
focal_method.parameters: (@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)
focal_method.return: String
focal_method.signature: String getJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response)