Reading a conf file in a test

scala

(Anurag870) #1

In a Play 2.4 framework application’s Scala test file there is a method that calls following code:

Play.application().classloader().getResourceAsStream(fileName)

which is returning stream as null for a fileName referring to a yaml file in the conf folder.

In the FunSuite testcase, I am using FakeApplication()

running(FakeApplication()) {
  ...
}

Could you please suggest, what can be wrong such that I am getting stream as null.