avaje / avaje-config

Application configuration / properties loading for JVM applications
https://avaje.io/config
Apache License 2.0
50 stars 8 forks source link

ENH: skip loading of application-test.yaml when system property suppressTestResource is set to true #35

Closed LIUTaichen closed 1 year ago

LIUTaichen commented 1 year ago

With System.setProperty("suppressTestResource", "true"); then the test resources application-test.yaml and application-test.properties will not be loaded.

This is desired to support the case where we want to run a main method in the test classpath that effectively uses the "main configuration" and ignores the "test configuration".

This use case is kind of a Utility that lives in src/test and has access to test dependencies etc but where we don't wish it to use the test configuration (we want it to ignore application-test.yaml etc).