java - Typesafe Config: Load configuration from src/test/resources -
this beginner question. app structure looks
src/main/java/... src/main/resources/application.conf src/test/java/... src/test/resources/module/test.module.conf
application.conf
location: mainlocation
test.module.conf
location: testlocation
in test,
@test public void testloadconfig() { final config config = configfactory.parseresources("test.module.conf"); system.out.println(config); }
and see
config(simpleconfigobject({}))
surely not right, can't spot
update
when just
@test public void testactorforfailure() { // final config config = configfactory.load("test.module.conf"); final config config = configfactory.load(); system.out.println(config.getstring("location")); }
i see
mainlocation
so overriding not working, why?
if want load test config file try this:
configfactory.load("modules/test.module")
the base configfactory.load()
method looks load 'application.conf'. if want load different file need tell different file is.
Comments
Post a Comment