@ApiOperation(value = "Get a single deadletter 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 = "/cmmn-management/deadletter-jobs/{jobId}", produces = "application/json")
    public JobResponse getDeadletterJob(@ApiParam(name = "jobId") @PathVariable String jobId) {
        Job job = getDeadLetterJobById(jobId);
        return restResponseFactory.createDeadLetterJobResponse(job);
    }
@Test
    @CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/management/timerEventListenerCase.cmmn" })
    public void testGetDeadLetterJob() throws Exception {
        CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("testTimerExpression").start();
        Job timerJob = managementService.createTimerJobQuery().caseInstanceId(caseInstance.getId()).singleResult();
        assertThat(timerJob).isNotNull();
        Job deadLetterJob = managementService.createDeadLetterJobQuery().caseInstanceId(caseInstance.getId()).singleResult();
        assertThat(deadLetterJob).isNull();

        managementService.moveJobToDeadLetterJob(timerJob.getId());

        timerJob = managementService.createTimerJobQuery().caseInstanceId(caseInstance.getId()).singleResult();
        assertThat(timerJob).isNull();

        deadLetterJob = managementService.createDeadLetterJobQuery().caseInstanceId(caseInstance.getId()).singleResult();
        assertThat(deadLetterJob).isNotNull();

        CloseableHttpResponse response = executeRequest(
                new HttpGet(SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEADLETTER_JOB, deadLetterJob.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: '" + deadLetterJob.getId() + "',"
                        + "exceptionMessage: " + deadLetterJob.getExceptionMessage() + ","
                        + "planItemInstanceId: '" + deadLetterJob.getSubScopeId() + "',"
                        + "caseDefinitionId: '" + deadLetterJob.getScopeDefinitionId() + "',"
                        + "caseInstanceId: '" + deadLetterJob.getScopeId() + "',"
                        + "elementId: 'timerListener',"
                        + "elementName: 'Timer listener',"
                        + "handlerType: 'cmmn-trigger-timer',"
                        + "retries: " + deadLetterJob.getRetries() + ","
                        + "dueDate: " + new TextNode(getISODateStringWithTZ(deadLetterJob.getDuedate())) + ","
                        + "tenantId: ''"
                        + "}");
        assertThat(responseNode.path("url").asText(null))
                .endsWith(CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_DEADLETTER_JOB, deadLetterJob.getId()));
    }