Search in sources :

Example 1 with DataTypes

use of org.datatransferproject.types.client.datatype.DataTypes in project data-transfer-project by google.

the class DataTypesActionTest method testHandle.

@Test
public void testHandle() {
    AuthServiceProviderRegistry registry = mock(AuthServiceProviderRegistry.class);
    Set<String> dataTypes = new HashSet<>(Arrays.asList("CONTACTS", "PHOTOS"));
    when(registry.getTransferDataTypes()).thenReturn(dataTypes);
    DataTypesAction dataTypesAction = new DataTypesAction(registry, new Monitor() {
    });
    GetDataTypes request = mock(GetDataTypes.class);
    DataTypes actual = dataTypesAction.handle(request);
    Assert.assertEquals(actual.getDataTypes(), dataTypes);
}
Also used : Monitor(org.datatransferproject.api.launcher.Monitor) AuthServiceProviderRegistry(org.datatransferproject.spi.api.auth.AuthServiceProviderRegistry) GetDataTypes(org.datatransferproject.types.client.datatype.GetDataTypes) HashSet(java.util.HashSet) DataTypes(org.datatransferproject.types.client.datatype.DataTypes) GetDataTypes(org.datatransferproject.types.client.datatype.GetDataTypes) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)1 Monitor (org.datatransferproject.api.launcher.Monitor)1 AuthServiceProviderRegistry (org.datatransferproject.spi.api.auth.AuthServiceProviderRegistry)1 DataTypes (org.datatransferproject.types.client.datatype.DataTypes)1 GetDataTypes (org.datatransferproject.types.client.datatype.GetDataTypes)1 Test (org.junit.Test)1