Search in sources :

Example 1 with GoogleDriveListProperties

use of org.talend.components.google.drive.list.GoogleDriveListProperties in project components by Talend.

the class GoogleDriveListReaderTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    // stubbing
    mockList = mock(List.class, RETURNS_DEEP_STUBS);
    when(drive.files().list()).thenReturn(mockList);
    when(drive.files().list().setQ(eq(qA)).execute()).thenReturn(createFolderFileList("A", false));
    when(drive.files().list().setQ(eq(qGSA)).execute()).thenReturn(createFolderFileList("A", false));
    when(drive.files().list().setQ(eq(qB)).execute()).thenReturn(createFolderFileList("B", false));
    when(drive.files().list().setQ(eq(qC)).execute()).thenReturn(createFolderFileList("C", false));
    // 
    properties = new GoogleDriveListProperties("test");
    properties.setupProperties();
    properties = (GoogleDriveListProperties) setupConnectionWithInstalledApplicationWithIdAndSecret(properties);
    properties.folder.setValue(FOLDER_ROOT);
}
Also used : List(com.google.api.services.drive.Drive.Files.List) FileList(com.google.api.services.drive.model.FileList) GoogleDriveListProperties(org.talend.components.google.drive.list.GoogleDriveListProperties) Before(org.junit.Before)

Aggregations

List (com.google.api.services.drive.Drive.Files.List)1 FileList (com.google.api.services.drive.model.FileList)1 Before (org.junit.Before)1 GoogleDriveListProperties (org.talend.components.google.drive.list.GoogleDriveListProperties)1