@Override
  public void copy(
      AuthData exportAuthData,
      AuthData importAuthData,
      UUID jobId,
      Optional<ExportInformation> exportInfo)
      throws IOException, CopyException {
    idempotentImportExecutor.setJobId(jobId);
    retryingIdempotentImportExecutor.setJobId(jobId);
    copyHelper(exportAuthData, importAuthData, jobId, exportInfo);
  }
@Test
  public void storeStackContainingPaginationDataAndMultipleSubResourcesInJobStore()
      throws CopyException, IOException {

    PaginationData paginationData = Mockito.mock(PaginationData.class);
    ContainerResource subResource1 = Mockito.mock(ContainerResource.class);
    ContainerResource subResource2 = Mockito.mock(ContainerResource.class);

    ExportInformation paginationExportInfo = new ExportInformation(paginationData, null);
    ExportInformation subResource1ExportInfo = new ExportInformation(null, subResource1);
    ExportInformation subResource2ExportInfo = new ExportInformation(null, subResource2);

    Stack<ExportInformation> jobStack = new Stack<>();
    jobStack.push(subResource2ExportInfo);
    jobStack.push(subResource1ExportInfo);
    jobStack.push(paginationExportInfo);

    Mockito.when(continuationData.getPaginationData()).thenReturn(paginationData);
    Mockito.when(continuationData.getContainerResources())
        .thenReturn(Arrays.asList(subResource1, subResource2));
    Mockito.when(initialExportResult.getContinuationData()).thenReturn(continuationData);
    Mockito.doReturn(initialExportResult)
        .when(stackInMemoryDataCopier)
        .copyIteration(
            jobId, exportAuthData, importAuthData, Optional.of(exportInfo), jobIdPrefix, 1);

    stackInMemoryDataCopier.copy(exportAuthData, importAuthData, jobId, Optional.of(exportInfo));

    InOrder orderVerifier = Mockito.inOrder(stackInMemoryDataCopier.jobStore);
    orderVerifier.verify(stackInMemoryDataCopier.jobStore).storeJobStack(jobId, jobStack);
    jobStack.pop();
    orderVerifier.verify(stackInMemoryDataCopier.jobStore).storeJobStack(jobId, jobStack);
    jobStack.pop();
    orderVerifier.verify(stackInMemoryDataCopier.jobStore).storeJobStack(jobId, jobStack);
    jobStack.pop();
    orderVerifier.verify(stackInMemoryDataCopier.jobStore).storeJobStack(jobId, jobStack);
  }