Search in sources :

Example 1 with AuthTestDriver

use of org.dataportabilityproject.auth.microsoft.harness.AuthTestDriver in project data-transfer-project by google.

the class LocalExportTestRunner method main.

@SuppressWarnings("unchecked")
public static void main(String... args) throws Exception {
    AuthTestDriver authTestDriver = new AuthTestDriver();
    MicrosoftTransferExtension serviceProvider = new MicrosoftTransferExtension();
    TokenAuthData token = authTestDriver.getOAuthTokenCode();
    Exporter<TokenAuthData, ContactsModelWrapper> contacts = (Exporter<TokenAuthData, ContactsModelWrapper>) serviceProvider.getExporter("contacts");
    ExportResult<ContactsModelWrapper> wrapper = contacts.export(UUID.randomUUID(), token);
}
Also used : TokenAuthData(org.dataportabilityproject.types.transfer.auth.TokenAuthData) MicrosoftTransferExtension(org.dataportabilityproject.transfer.microsoft.MicrosoftTransferExtension) ContactsModelWrapper(org.dataportabilityproject.types.transfer.models.contacts.ContactsModelWrapper) AuthTestDriver(org.dataportabilityproject.auth.microsoft.harness.AuthTestDriver) Exporter(org.dataportabilityproject.spi.transfer.provider.Exporter)

Example 2 with AuthTestDriver

use of org.dataportabilityproject.auth.microsoft.harness.AuthTestDriver in project data-transfer-project by google.

the class LocalImportTestRunner method main.

@SuppressWarnings("unchecked")
public static void main(String... args) throws Exception {
    AuthTestDriver authTestDriver = new AuthTestDriver();
    MicrosoftTransferExtension serviceProvider = new MicrosoftTransferExtension();
    TokenAuthData token = authTestDriver.getOAuthTokenCode();
    Importer<TokenAuthData, ContactsModelWrapper> contacts = (Importer<TokenAuthData, ContactsModelWrapper>) serviceProvider.getImporter("contacts");
    ContactsModelWrapper wrapper = new ContactsModelWrapper(createCards());
    ImportResult result = contacts.importItem(UUID.randomUUID(), token, wrapper);
}
Also used : ImportResult(org.dataportabilityproject.spi.transfer.provider.ImportResult) TokenAuthData(org.dataportabilityproject.types.transfer.auth.TokenAuthData) MicrosoftTransferExtension(org.dataportabilityproject.transfer.microsoft.MicrosoftTransferExtension) ContactsModelWrapper(org.dataportabilityproject.types.transfer.models.contacts.ContactsModelWrapper) AuthTestDriver(org.dataportabilityproject.auth.microsoft.harness.AuthTestDriver) Importer(org.dataportabilityproject.spi.transfer.provider.Importer)

Aggregations

AuthTestDriver (org.dataportabilityproject.auth.microsoft.harness.AuthTestDriver)2 MicrosoftTransferExtension (org.dataportabilityproject.transfer.microsoft.MicrosoftTransferExtension)2 TokenAuthData (org.dataportabilityproject.types.transfer.auth.TokenAuthData)2 ContactsModelWrapper (org.dataportabilityproject.types.transfer.models.contacts.ContactsModelWrapper)2 Exporter (org.dataportabilityproject.spi.transfer.provider.Exporter)1 ImportResult (org.dataportabilityproject.spi.transfer.provider.ImportResult)1 Importer (org.dataportabilityproject.spi.transfer.provider.Importer)1