use of org.talend.components.google.drive.delete.GoogleDriveDeleteProperties in project components by Talend.
the class GoogleDriveDeleteReaderTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
//
properties = new GoogleDriveDeleteProperties("test");
properties.setupProperties();
properties = (GoogleDriveDeleteProperties) setupConnectionWithInstalledApplicationWithJson(properties);
//
properties.file.setValue(FOLDER_DELETE);
when(drive.files().update(anyString(), any(File.class)).execute()).thenReturn(null);
when(drive.files().delete(anyString()).execute()).thenReturn(null);
FileList fileList = new FileList();
List<File> files = new ArrayList<>();
File f = new File();
f.setId(FOLDER_DELETE_ID);
files.add(f);
fileList.setFiles(files);
when(drive.files().list().setQ(anyString()).execute()).thenReturn(fileList);
}
use of org.talend.components.google.drive.delete.GoogleDriveDeleteProperties in project components by Talend.
the class GoogleDriveDeleteRuntimeTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
properties = new GoogleDriveDeleteProperties("test");
properties.setupProperties();
properties = (GoogleDriveDeleteProperties) setupConnectionWithInstalledApplicationWithJson(properties);
//
properties.file.setValue(FOLDER_DELETE);
testRuntime = spy(GoogleDriveDeleteRuntime.class);
doReturn(drive).when(testRuntime).getDriveService();
when(drive.files().update(anyString(), any(File.class)).execute()).thenReturn(null);
when(drive.files().delete(anyString()).execute()).thenReturn(null);
deleteFileList = new FileList();
List<File> files = new ArrayList<>();
File f = new File();
f.setId(FOLDER_DELETE_ID);
files.add(f);
deleteFileList.setFiles(files);
}
Aggregations