use of org.dataportabilityproject.spi.transfer.types.ExportInformation in project data-transfer-project by google.
the class GoogleContactsExporterTest method exportSubsequentPage.
@Test
public void exportSubsequentPage() throws IOException {
setUpSinglePersonResponse();
// Looking at a subsequent page, with no pages after it
PaginationData paginationData = new StringPaginationToken(NEXT_PAGE_TOKEN);
ExportInformation exportInformation = new ExportInformation(paginationData, null);
listConnectionsResponse.setNextPageToken(null);
when(listConnectionsRequest.setPageToken(NEXT_PAGE_TOKEN)).thenReturn(listConnectionsRequest);
// Run test
ExportResult<ContactsModelWrapper> result = contactsService.export(UUID.randomUUID(), null, exportInformation);
// Verify correct calls were made - i.e., token was added before execution
InOrder inOrder = Mockito.inOrder(listConnectionsRequest);
inOrder.verify(listConnectionsRequest).setPageToken(NEXT_PAGE_TOKEN);
inOrder.verify(listConnectionsRequest).execute();
// Check continuation data
ContinuationData continuationData = (ContinuationData) result.getContinuationData();
assertThat(continuationData.getContainerResources()).isEmpty();
assertThat(continuationData.getPaginationData()).isNull();
}
use of org.dataportabilityproject.spi.transfer.types.ExportInformation in project data-transfer-project by google.
the class PortabilityInMemoryDataCopier method copy.
/**
* Kicks off transfer job {@code jobId} from {@code exporter} to {@code importer}.
*/
@Override
public void copy(AuthData exportAuthData, AuthData importAuthData, UUID jobId) throws IOException {
// Initial copy, starts off the process with no previous paginationData or containerResource
// information
ExportInformation emptyExportInfo = new ExportInformation(null, null);
copyHelper(jobId, exportAuthData, importAuthData, emptyExportInfo);
}
Aggregations