### Question:
DelfiSubmitService implements SubmitService { @Override public DelfiIngestedFile getIngestedFile(SubmittedFile file, JobStatusResponse response, RequestContext requestContext) { String location = GCS_PROTOCOL + response.getSummary().getOutputLocation() + SUCCESS_METADATA_JSON_PATH; log.debug("File location of ingestion job success metadata: {}", location); DelfiFile delfiFile = portalService.getFile(location, requestContext.getAuthorizationToken(), requestContext.getPartition()); String fileContent = restTemplate.getForObject(delfiFile.getSignedUrl(), String.class); log.debug("Success metadata: {}", fileContent); SuccessMetadata metadata = toObject(fileContent, SuccessMetadata.class); SaveRecordsResult saveResult = toObject(metadata.getMessage(), SaveRecordsResult.class); log.debug("Save records result: {}", saveResult); return DelfiIngestedFile.builder() .submittedFile(file) .recordId(saveResult.getRecordIds().get(0)) .build(); }  @Override JobPollingResult awaitSubmitJob(String jobId, RequestContext requestContext); @Override SubmitJobResult submitFile(SubmitFileContext fileContext, RequestContext requestContext); @Override DelfiIngestedFile getIngestedFile(SubmittedFile file, JobStatusResponse response,
      RequestContext requestContext);  }### Answer:
@Test public void shouldFetchRecordIdOfIngestedFile() { String outputLocation = "/some-ingestion-persistent-zone/some-user/uuid/output"; String fileRelativePath = outputLocation + SUCCESS_METADATA_JSON_PATH; String fileUri = GCS_PROTOCOL + fileRelativePath; String fileSignedUrl = STORAGE_HREF + fileRelativePath + "?AccessId=datafier@email.com&Expires=123&Signature=lX"; SubmittedFile file = SubmittedFile.builder().build(); JobStatusResponse jobStatusResponse = JobStatusResponse.builder() .summary(Summary.builder() .outputLocation(outputLocation) .build()) .jobInfo(JobInfo.builder() .jobId(JOB_ID_1) .masterJobStatus(COMPLETED) .build()) .build(); RequestContext requestContext = getRequestContext(); DelfiFile delfiFile = DelfiFile.builder() .signedUrl(fileSignedUrl) .build(); String jobMetadata = getMetadataFileContent(DELFI_RECORD_ID_1); given(portalService.getFile(fileUri, AUTHORIZATION_TOKEN, PARTITION)) .willReturn(delfiFile); given(restTemplate.getForObject(fileSignedUrl, String.class)) .willReturn(jobMetadata); DelfiIngestedFile ingestedFile = submitService .getIngestedFile(file, jobStatusResponse, requestContext); then(ingestedFile).isEqualTo(DelfiIngestedFile.builder() .submittedFile(file) .recordId(DELFI_RECORD_ID_1) .build()); InOrder inOrder = Mockito.inOrder(restTemplate, delfiIngestionClient, portalService); inOrder.verify(portalService).getFile(fileUri, AUTHORIZATION_TOKEN, PARTITION); inOrder.verify(restTemplate).getForObject(fileSignedUrl, String.class); inOrder.verifyNoMoreInteractions(); }