Search in sources :

Example 1 with InMemoryJobDataCache

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);
}
Also used : Connections(com.google.api.services.people.v1.PeopleService.People.Connections) PeopleService(com.google.api.services.people.v1.PeopleService) People(com.google.api.services.people.v1.PeopleService.People) CreateContact(com.google.api.services.people.v1.PeopleService.People.CreateContact) InMemoryJobDataCache(org.dataportabilityproject.cloud.local.InMemoryJobDataCache) LinkedList(java.util.LinkedList) List(java.util.List) GetBatchGet(com.google.api.services.people.v1.PeopleService.People.GetBatchGet) Person(com.google.api.services.people.v1.model.Person) Before(org.junit.Before)

Example 2 with InMemoryJobDataCache

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);
}
Also used : Events(com.google.api.services.calendar.model.Events) Calendar(com.google.api.services.calendar.Calendar) InMemoryJobDataCache(org.dataportabilityproject.cloud.local.InMemoryJobDataCache) CalendarList(com.google.api.services.calendar.model.CalendarList) CalendarList(com.google.api.services.calendar.model.CalendarList) Before(org.junit.Before)

Aggregations

InMemoryJobDataCache (org.dataportabilityproject.cloud.local.InMemoryJobDataCache)2 Before (org.junit.Before)2 Calendar (com.google.api.services.calendar.Calendar)1 CalendarList (com.google.api.services.calendar.model.CalendarList)1 Events (com.google.api.services.calendar.model.Events)1 PeopleService (com.google.api.services.people.v1.PeopleService)1 People (com.google.api.services.people.v1.PeopleService.People)1 Connections (com.google.api.services.people.v1.PeopleService.People.Connections)1 CreateContact (com.google.api.services.people.v1.PeopleService.People.CreateContact)1 GetBatchGet (com.google.api.services.people.v1.PeopleService.People.GetBatchGet)1 Person (com.google.api.services.people.v1.model.Person)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1