use of org.talend.components.google.drive.create.GoogleDriveCreateProperties in project components by Talend.
the class GoogleDriveCreateReaderTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
properties = new GoogleDriveCreateProperties("test");
properties.setupProperties();
properties = (GoogleDriveCreateProperties) setupConnectionWithInstalledApplicationWithIdAndSecret(properties);
//
properties.parentFolder.setValue(FOLDER_ROOT);
properties.newFolder.setValue(FOLDER_CREATE);
File fc = new File();
fc.setId(FOLDER_CREATE_ID);
when(drive.files().create(any(File.class)).setFields(eq("id")).execute()).thenReturn(fc);
}
use of org.talend.components.google.drive.create.GoogleDriveCreateProperties in project components by Talend.
the class GoogleDriveCreateRuntimeTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
properties = new GoogleDriveCreateProperties("test");
properties.setupProperties();
properties = (GoogleDriveCreateProperties) setupConnectionWithInstalledApplicationWithIdAndSecret(properties);
//
properties.parentFolder.setValue(FOLDER_ROOT);
properties.newFolder.setValue(FOLDER_CREATE);
testRuntime = spy(GoogleDriveCreateRuntime.class);
doReturn(drive).when(testRuntime).getDriveService();
File fc = new File();
fc.setId(FOLDER_CREATE_ID);
when(drive.files().create(any(File.class)).setFields(eq("id")).execute()).thenReturn(fc);
//
FileList flA = new FileList();
List<File> fs = new ArrayList<>();
File fA = new File();
fA.setId("A");
fs.add(fA);
flA.setFiles(fs);
when(drive.files().list().setQ(eq(qA)).execute()).thenReturn(flA);
FileList flB = new FileList();
List<File> fsA = new ArrayList<>();
File fB = new File();
fB.setId("B");
fsA.add(fB);
flB.setFiles(fsA);
when(drive.files().list().setQ(eq(qB)).execute()).thenReturn(flB);
FileList flC = new FileList();
List<File> fsC = new ArrayList<>();
File fC = new File();
fC.setId("C");
fsC.add(fC);
flC.setFiles(fsC);
when(drive.files().list().setQ(eq(qC)).execute()).thenReturn(flC);
}
Aggregations