use of org.talend.components.google.drive.get.GoogleDriveGetProperties in project components by Talend.
the class GoogleDriveGetRuntimeTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
properties = new GoogleDriveGetProperties("test");
properties.setupProperties();
properties = (GoogleDriveGetProperties) setupConnectionWithInstalledApplicationWithJson(properties);
//
properties.file.setValue("google-drive-get");
testRuntime = spy(GoogleDriveGetRuntime.class);
doReturn(drive).when(testRuntime).getDriveService();
FileList fileList = new FileList();
List<File> files = new ArrayList<>();
File f = new File();
f.setId(FILE_GET_ID);
files.add(f);
fileList.setFiles(files);
when(drive.files().list().setQ(anyString()).execute()).thenReturn(fileList);
File file = new File();
file.setId("fileName-id");
file.setMimeType(GoogleDriveMimeTypes.MIME_TYPE_JSON);
file.setFileExtension("json");
when(drive.files().get(anyString()).setFields(anyString()).execute()).thenReturn(file);
}
use of org.talend.components.google.drive.get.GoogleDriveGetProperties in project components by Talend.
the class GoogleDriveGetReaderTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
//
properties = new GoogleDriveGetProperties("test");
properties.setupProperties();
properties = (GoogleDriveGetProperties) setupConnectionWithInstalledApplicationWithJson(properties);
//
properties.file.setValue("google-drive-get");
FileList fileList = new FileList();
List<File> files = new ArrayList<>();
File f = new File();
f.setId(FILE_GET_ID);
files.add(f);
fileList.setFiles(files);
when(drive.files().list().setQ(anyString()).execute()).thenReturn(fileList);
File file = new File();
file.setId(FILE_GET_ID);
file.setMimeType(GoogleDriveMimeTypes.MIME_TYPE_JSON);
file.setFileExtension("json");
when(drive.files().get(anyString()).setFields(anyString()).execute()).thenReturn(file);
}
Aggregations