This is a beginner question. So my app structure looks like
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 my test, I do
@Test
public void testLoadConfig() {
final Config config = ConfigFactory.parseResources("test.module.conf");
System.out.println(config);
}
and what I see
Config(SimpleConfigObject({}))
Surely something is not right, but I can't spot it
UPDATE
When I do 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 is not working, why?
If you want to load that test config file try this:
ConfigFactory.load("modules/test.module")
The base ConfigFactory.load()
method looks to load 'application.conf'. If you want it to load a different file you need to tell it what that different file is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With