scala - Play: Run tests with custom GuiceApplicationLoader -
i have customapplicationloader extends guiceapplicationloader in loading environment specific conf file. when run tests in applicationspec values taken environment specific conf files missing supposedly means customapplicationloader hasn't been executed.
any idea how pass customapplicationloader on fakeapplication or other approach read values conf files during tests? or shouldn't work out of box?
so found out can inject custom guiceapplicationloader passing argument withapplicationloader this:
@runwith(classof[junitrunner]) class applicationspec extends specification { "my component" should { "load environment specific conf values loaded in customapplicationloader" in new withapplicationloader(new customapplicationloader) { ... } } }
Comments
Post a Comment