Search in sources :

Example 1 with TransformerServiceImpl

use of org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl in project data-transfer-project by google.

the class MicrosoftCalendarExportTest method setUp.

@Before
public void setUp() {
    client = new OkHttpClient.Builder().build();
    mapper = new ObjectMapper();
    transformerService = new TransformerServiceImpl();
    token = new TokenAuthData("token123");
    server = new MockWebServer();
}
Also used : TokenAuthData(org.dataportabilityproject.types.transfer.auth.TokenAuthData) MockWebServer(com.squareup.okhttp.mockwebserver.MockWebServer) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) TransformerServiceImpl(org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl) Before(org.junit.Before)

Example 2 with TransformerServiceImpl

use of org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl in project data-transfer-project by google.

the class MicrosoftTransferExtension method getImporter.

@Override
public Importer<?, ?> getImporter(String transferDataType) {
    OkHttpClient client = new OkHttpClient.Builder().build();
    ObjectMapper mapper = new ObjectMapper();
    TransformerService transformerService = new TransformerServiceImpl();
    if (transferDataType.equals(CONTACTS)) {
        return new MicrosoftContactsImporter(BASE_GRAPH_URL, client, mapper, transformerService);
    }
    if (transferDataType.equals(CALENDAR)) {
        return new MicrosoftCalendarImporter(BASE_GRAPH_URL, client, mapper, transformerService, jobStore);
    }
    return null;
}
Also used : OkHttpClient(okhttp3.OkHttpClient) MicrosoftCalendarImporter(org.dataportabilityproject.transfer.microsoft.calendar.MicrosoftCalendarImporter) TransformerService(org.dataportabilityproject.transfer.microsoft.transformer.TransformerService) MicrosoftContactsImporter(org.dataportabilityproject.transfer.microsoft.contacts.MicrosoftContactsImporter) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) TransformerServiceImpl(org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl)

Example 3 with TransformerServiceImpl

use of org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl in project data-transfer-project by google.

the class MicrosoftTransferExtension method getExporter.

@Override
public Exporter<?, ?> getExporter(String transferDataType) {
    // TODO consider memoizing w/ Supplier but we will only use once and pass to worker.
    // This could allow us to refactor these params into supplier.
    OkHttpClient client = new OkHttpClient.Builder().build();
    ObjectMapper mapper = new ObjectMapper();
    TransformerService transformerService = new TransformerServiceImpl();
    if (transferDataType.equals(CONTACTS)) {
        return new MicrosoftContactsExporter(BASE_GRAPH_URL, client, mapper, transformerService);
    }
    if (transferDataType.equals(CALENDAR)) {
        return new MicrosoftCalendarExporter(BASE_GRAPH_URL, client, mapper, transformerService);
    }
    return null;
}
Also used : MicrosoftCalendarExporter(org.dataportabilityproject.transfer.microsoft.calendar.MicrosoftCalendarExporter) MicrosoftContactsExporter(org.dataportabilityproject.transfer.microsoft.contacts.MicrosoftContactsExporter) OkHttpClient(okhttp3.OkHttpClient) TransformerService(org.dataportabilityproject.transfer.microsoft.transformer.TransformerService) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) TransformerServiceImpl(org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl)

Example 4 with TransformerServiceImpl

use of org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl in project data-transfer-project by google.

the class MicrosoftCalendarImportTest method setUp.

@Before
public void setUp() {
    client = new OkHttpClient.Builder().build();
    mapper = new ObjectMapper();
    transformerService = new TransformerServiceImpl();
    token = new TokenAuthData("token456");
    server = new MockWebServer();
    jobStore = new MockJobStore();
}
Also used : TokenAuthData(org.dataportabilityproject.types.transfer.auth.TokenAuthData) MockWebServer(com.squareup.okhttp.mockwebserver.MockWebServer) MockJobStore(org.dataportabilityproject.transfer.microsoft.helper.MockJobStore) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) TransformerServiceImpl(org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl) Before(org.junit.Before)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 TransformerServiceImpl (org.dataportabilityproject.transfer.microsoft.transformer.TransformerServiceImpl)4 MockWebServer (com.squareup.okhttp.mockwebserver.MockWebServer)2 OkHttpClient (okhttp3.OkHttpClient)2 TransformerService (org.dataportabilityproject.transfer.microsoft.transformer.TransformerService)2 TokenAuthData (org.dataportabilityproject.types.transfer.auth.TokenAuthData)2 Before (org.junit.Before)2 MicrosoftCalendarExporter (org.dataportabilityproject.transfer.microsoft.calendar.MicrosoftCalendarExporter)1 MicrosoftCalendarImporter (org.dataportabilityproject.transfer.microsoft.calendar.MicrosoftCalendarImporter)1 MicrosoftContactsExporter (org.dataportabilityproject.transfer.microsoft.contacts.MicrosoftContactsExporter)1 MicrosoftContactsImporter (org.dataportabilityproject.transfer.microsoft.contacts.MicrosoftContactsImporter)1 MockJobStore (org.dataportabilityproject.transfer.microsoft.helper.MockJobStore)1