### Question:
JobResource extends AbstractJobResource { List<JobCompletionModel.FhirExtension> buildOutputEntryExtension(JobQueueBatchFile batchFile) { final byte[] byteChecksum = batchFile.getChecksum(); final String stringChecksum; if (byteChecksum == null) { stringChecksum = ""; } else { stringChecksum = Hex.toHexString(byteChecksum); } String formattedChecksum = String.format("%s:%s", "sha256", stringChecksum); long fileLength = batchFile.getFileLength(); return List.of(new JobCompletionModel.FhirExtension(JobCompletionModel.CHECKSUM_URL, formattedChecksum), new JobCompletionModel.FhirExtension(JobCompletionModel.FILE_LENGTH_URL, fileLength)); } @Inject  JobResource(IJobQueue queue, @APIV1 String baseURL); @Override @Path("/{jobID}") @GET @Timed @ExceptionMetered @ApiOperation(value = "Check export job status", notes = "This endpoint is used to query the status of a given Export operation. " + "When the job is in progress, the API returns a 202 status." + "When completed, an output response is returned, which contains the necessary metadata for retrieving any output files.") @ApiResponses({ @ApiResponse(code = 200, message = "Export job has completed. Any failures are listed in the response body", response = JobCompletionModel.class), @ApiResponse(code = 202, message = "Export job is in progress. X-Progress header is present with the format \"<STATUS>: <50.00%>\""), @ApiResponse(code = 404, message = "Export job cannot be found"), @ApiResponse(code = 410, message = "Job has expired"), @ApiResponse(code = 500, message = "Export job has failed with no results") }) Response checkJobStatus(@Auth OrganizationPrincipal organizationPrincipal, @PathParam("jobID") @NoHtml String jobID); static OffsetDateTime getLatestBatchCompleteTime(List<JobQueueBatch> batches); static final int JOB_EXPIRATION_HOURS; static final DateTimeFormatter HTTP_DATE_FORMAT; }### Answer:
@Test public void testBuildOutputEntryExtension() { final var resource = new JobResource(null, ""); final var file = new JobQueueBatchFile(UUID.randomUUID(), UUID.fromString("f1e518f5-4977-47c6-971b-7eeaf1b433e8"), ResourceType.Patient, 0, 11); file.setChecksum(Hex.decode("9d251cea787379c603af13f90c26a9b2a4fbb1e029793ae0f688c5631cdb6a1b")); file.setFileLength(7202L); List<JobCompletionModel.FhirExtension> extension = resource.buildOutputEntryExtension(file); assertAll(() -> assertEquals(JobCompletionModel.CHECKSUM_URL, extension.get(0).getUrl()), () -> assertEquals("sha256:9d251cea787379c603af13f90c26a9b2a4fbb1e029793ae0f688c5631cdb6a1b", extension.get(0).getValueString()), () -> assertEquals(JobCompletionModel.FILE_LENGTH_URL, extension.get(1).getUrl()), () -> assertEquals(7202L, extension.get(1).getValueDecimal())); }