@ApiOperation(value = "Get a single suspended job", tags = { "Jobs" })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates the suspended job exists and is returned."),
            @ApiResponse(code = 404, message = "Indicates the requested job does not exist.")
    })
    @GetMapping(value = "/management/suspended-jobs/{jobId}", produces = "application/json")
    public JobResponse getSuspendedJob(@ApiParam(name = "jobId") @PathVariable String jobId) {
        Job job = getSuspendedJobById(jobId);
        return restResponseFactory.createSuspendedJobResponse(job);
    }
@Test
    @Deployment(resources = { "org/flowable/rest/service/api/management/JobResourceTest.testTimerProcess.bpmn20.xml" })
    public void testGetSuspendedJob() throws Exception {
        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("timerProcess");
        Job timerJob = managementService.createTimerJobQuery().processInstanceId(processInstance.getId()).singleResult();
        assertThat(timerJob).isNotNull();
        Job suspendedJob = managementService.createSuspendedJobQuery().processInstanceId(processInstance.getId()).singleResult();
        assertThat(suspendedJob).isNull();

        runtimeService.suspendProcessInstanceById(processInstance.getId());

        timerJob = managementService.createTimerJobQuery().processInstanceId(processInstance.getId()).singleResult();
        assertThat(timerJob).isNull();

        suspendedJob = managementService.createSuspendedJobQuery().processInstanceId(processInstance.getId()).singleResult();
        assertThat(suspendedJob).isNotNull();

        CloseableHttpResponse response = executeRequest(
                new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_SUSPENDED_JOB, suspendedJob.getId())), HttpStatus.SC_OK);
        JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
        closeResponse(response);
        assertThat(responseNode).isNotNull();
        assertThatJson(responseNode)
                .when(Option.IGNORING_EXTRA_FIELDS)
                .isEqualTo("{"
                        + "id: '" + suspendedJob.getId() + "',"
                        + "correlationId: '" + suspendedJob.getCorrelationId() + "',"
                        + "exceptionMessage: " + suspendedJob.getExceptionMessage() + ","
                        + "executionId: '" + suspendedJob.getExecutionId() + "',"
                        + "processDefinitionId: '" + suspendedJob.getProcessDefinitionId() + "',"
                        + "processInstanceId: '" + suspendedJob.getProcessInstanceId() + "',"
                        + "elementId: 'escalationTimer',"
                        + "elementName: 'Escalation',"
                        + "handlerType: 'trigger-timer',"
                        + "retries: " + suspendedJob.getRetries() + ","
                        + "dueDate: " + new TextNode(getISODateStringWithTZ(suspendedJob.getDuedate())) + ","
                        + "tenantId: ''"
                        + "}");
        assertThat(responseNode.path("url").asText(null))
                .endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_SUSPENDED_JOB, suspendedJob.getId()));

        // Set tenant on deployment
        managementService.executeCommand(new ChangeDeploymentTenantIdCmd(deploymentId, "myTenant"));

        response = executeRequest(new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_SUSPENDED_JOB, suspendedJob.getId())),
                HttpStatus.SC_OK);
        responseNode = objectMapper.readTree(response.getEntity().getContent());
        closeResponse(response);
        assertThat(responseNode).isNotNull();
        assertThatJson(responseNode)
                .when(Option.IGNORING_EXTRA_FIELDS)
                .isEqualTo("{"
                        + "tenantId: 'myTenant'"
                        + "}");
    }