4
votes

I have a Scala/Play application using settings specific to the environment. This is a part of application.conf

foo {
  bar {
    enabled = false
    enabled = ${?ENABLE}
  }
}

This will be set to true only on production environment. To test however I need to simulate production environment without editing this configuration. How can I override this variable to true using ScalaTest+Play?

1
Add an application.conf in your test/resources directory with desired config. - curious

1 Answers

3
votes

Use javaOptions in Test += "-Dconfig.file=conf/application.test.conf".