Search in sources :

Example 1 with PeopleService

use of com.google.api.services.people.v1.PeopleService 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)

Aggregations

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 InMemoryJobDataCache (org.dataportabilityproject.cloud.local.InMemoryJobDataCache)1 Before (org.junit.Before)1