colintheshots
05/22/2020, 4:22 PM<http://java.io|java.io>.File.inputStream()
extension function, but the FileInputStream
constructor still gets run.
mockkStatic("<http://kotlin.io|kotlin.io>.FilesKt__FileReadWriteKt")
val fileInputStream = FileInputStream(realFileUri)
every { any<File>().inputStream() } returns fileInputStream
storage.readConfig() // calls file.inputStream()
The constructor of FileInputStream
seems to think the mock operand is null and explicitly throws NullPointerException
.
Any ideas how best to resolve this?