use of org.dataportabilityproject.cloud.local.InMemoryJobDataCache in project data-transfer-project by google.
the class GoogleContactsServiceTest method setup.
@Before
public void setup() throws IOException {
connections = mock(Connections.class);
getBatchGet = mock(GetBatchGet.class);
people = mock(People.class);
peopleService = mock(PeopleService.class);
listConnectionsRequest = mock(Connections.List.class);
createContact = mock(CreateContact.class);
jobDataCache = new InMemoryJobDataCache();
contactsService = new GoogleContactsService(peopleService, jobDataCache);
when(getBatchGet.setPersonFields(PERSON_FIELDS)).thenReturn(getBatchGet);
when(people.connections()).thenReturn(connections);
when(people.getBatchGet()).thenReturn(getBatchGet);
when(people.createContact(any(Person.class))).thenReturn(createContact);
when(peopleService.people()).thenReturn(people);
}
use of org.dataportabilityproject.cloud.local.InMemoryJobDataCache in project data-transfer-project by google.
the class GoogleCalendarServiceTest method setup.
@Before
public void setup() throws IOException {
calendarCalendars = mock(Calendar.Calendars.class);
calendarCalendarList = mock(Calendar.CalendarList.class);
calendarListRequest = mock(Calendar.CalendarList.List.class);
calendarInsertRequest = mock(Calendar.Calendars.Insert.class);
calendarEvents = mock(Calendar.Events.class);
eventListRequest = mock(Calendar.Events.List.class);
eventInsertRequest = mock(Calendar.Events.Insert.class);
calendarClient = mock(Calendar.class);
jobDataCache = new InMemoryJobDataCache();
calendarService = new GoogleCalendarService(calendarClient, jobDataCache);
when(calendarClient.calendars()).thenReturn(calendarCalendars);
when(calendarClient.calendarList()).thenReturn(calendarCalendarList);
when(calendarCalendarList.list()).thenReturn(calendarListRequest);
when(calendarClient.events()).thenReturn(calendarEvents);
when(calendarEvents.list(CALENDAR_ID)).thenReturn(eventListRequest);
when(eventListRequest.setMaxAttendees(GoogleStaticObjects.MAX_ATTENDEES)).thenReturn(eventListRequest);
}
Aggregations