@@ -23,16 +23,13 @@ import java.net.URI
23
23
import scala .util .Random
24
24
25
25
import org .apache .hadoop .fs .{FileStatus , Path , RawLocalFileSystem }
26
- import org .scalatest .mock .MockitoSugar
27
26
28
27
import org .apache .spark .SparkFunSuite
29
28
import org .apache .spark .sql .execution .streaming .ExistsThrowsExceptionFileSystem ._
30
29
import org .apache .spark .sql .test .SharedSQLContext
31
30
import org .apache .spark .sql .types .StructType
32
31
33
- class FileStreamSourceSuite extends SparkFunSuite
34
- with SharedSQLContext
35
- with MockitoSugar {
32
+ class FileStreamSourceSuite extends SparkFunSuite with SharedSQLContext {
36
33
37
34
import FileStreamSource ._
38
35
@@ -104,7 +101,9 @@ class FileStreamSourceSuite extends SparkFunSuite
104
101
}
105
102
}
106
103
107
- /** FakeFileSystem to test fallback of the HDFSMetadataLog from FileContext to FileSystem API */
104
+ /** Fake FileSystem to test whether the method `fs.exists` is called during
105
+ * `DataSource.resolveRelation`.
106
+ */
108
107
class ExistsThrowsExceptionFileSystem extends RawLocalFileSystem {
109
108
override def getUri : URI = {
110
109
URI .create(s " $scheme:/// " )
@@ -114,6 +113,7 @@ class ExistsThrowsExceptionFileSystem extends RawLocalFileSystem {
114
113
throw new IllegalArgumentException (" Exists shouldn't have been called!" )
115
114
}
116
115
116
+ /** Simply return an empty file for now. */
117
117
override def listStatus (file : Path ): Array [FileStatus ] = {
118
118
val emptyFile = new FileStatus ()
119
119
emptyFile.setPath(file)
0 commit comments