use of org.datatransferproject.types.client.datatype.GetDataTypes 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);
}
use of org.datatransferproject.types.client.datatype.GetDataTypes in project data-transfer-project by google.
the class DataTypesActionTest method testGetRequestType.
@Test
public void testGetRequestType() {
AuthServiceProviderRegistry registry = mock(AuthServiceProviderRegistry.class);
DataTypesAction dataTypesAction = new DataTypesAction(registry, new Monitor() {
});
Class<GetDataTypes> actual = dataTypesAction.getRequestType();
Assert.assertNotEquals(actual, null);
Assert.assertEquals(actual, GetDataTypes.class);
}
Aggregations