'FileNotFoundException scala unit test fails in jenkins

I am testing fileNotFoundException when unit testing my scala code using scalatest in intellij.

The code runs fine in local but fails in jenkins build. Below is the testcase.

test("fileNotFound"){
val inputFile="src/test/invalid/path"
val 
thrown=intercept[Exception]{readFile(inputFile)}
assert (thrown.toString==="some string")

}

Jenkins fails with assertion not be true. The same code runs in local as expected.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source