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));
}
Aggregations