use of org.pentaho.googledrive.vfs.GoogleDriveFileObject in project pentaho-kettle by pentaho.
the class GoogleDriveFileObjectTest method testFileObject.
@Test
public void testFileObject() throws Exception {
FileSystemManager manager = mock(FileSystemManager.class);
GoogleDriveFileObject fileObjectMock = mock(GoogleDriveFileObject.class);
when(manager.resolveFile(FOLDER)).thenReturn(fileObjectMock);
when(fileObjectMock.isFolder()).thenReturn(true);
when(fileObjectMock.exists()).thenReturn(true);
when(fileObjectMock.delete()).thenReturn(true);
FileObject fileObject = manager.resolveFile(FOLDER);
fileObject.createFolder();
assertTrue(fileObject.isFolder());
assertTrue(fileObject.exists());
assertTrue(fileObject.delete());
assertNull(fileObject.getChildren());
}
Aggregations