Search in sources :

Example 1 with PortabilityAuthServiceProviderRegistry

use of org.dataportabilityproject.gateway.PortabilityAuthServiceProviderRegistry in project data-transfer-project by google.

the class PortabilityAuthServiceExtensionRegistryTest method requireImportAndExportTest.

@Test
public void requireImportAndExportTest() {
    List<String> supportedImportTypes = ImmutableList.of("photos", "contacts");
    List<String> supportedExportTypes = ImmutableList.of("contacts");
    AuthServiceExtension mockAuthProvider = mock(AuthServiceExtension.class);
    when(mockAuthProvider.getExportTypes()).thenReturn(supportedExportTypes);
    when(mockAuthProvider.getImportTypes()).thenReturn(supportedImportTypes);
    when(mockAuthProvider.getServiceId()).thenReturn("mockAuthProvider");
    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage("available for import but not export");
    AuthServiceProviderRegistry registry = new PortabilityAuthServiceProviderRegistry(ImmutableMap.of("mockServiceProvider", mockAuthProvider));
}
Also used : PortabilityAuthServiceProviderRegistry(org.dataportabilityproject.gateway.PortabilityAuthServiceProviderRegistry) PortabilityAuthServiceProviderRegistry(org.dataportabilityproject.gateway.PortabilityAuthServiceProviderRegistry) AuthServiceExtension(org.dataportabilityproject.spi.gateway.auth.extension.AuthServiceExtension) Test(org.junit.Test)

Aggregations

PortabilityAuthServiceProviderRegistry (org.dataportabilityproject.gateway.PortabilityAuthServiceProviderRegistry)1 AuthServiceExtension (org.dataportabilityproject.spi.gateway.auth.extension.AuthServiceExtension)1 Test (org.junit.Test)1