Quick poll. Should a server under test be configured with
application.conf
from the
main
sourceset if the config in the
test
sourceset is absent?
👌
🚫
🚫 3
👌 9
a
antonarhipov
06/27/2022, 3:10 PM
Yes and no. for tests, it is rather important to be able to override the properties dynamically.
Because if we speak of testing in the context of a web framework, it most likely means that we are talking about integration tests. And today people use containers to boot the external dependencies for such testing, e.g. Testcontainers. Hence, even if the test app can configure itself with application.conf it is not enough - it should be possible to override the individual properties depending on the conditions when the test is already running
âž• 2
antonarhipov
06/27/2022, 3:11 PM
(I know my answer wasn’t exactly to the question posted 🙂 but I couldn’t resist)
a
Aleksei Tirman [JB]
06/27/2022, 3:20 PM
So your point is that a
test
config should override properties in
main
config?
a
antonarhipov
06/27/2022, 3:22 PM
no-no-no. I think it wouldn’t be a great idea.
picking up config from main if it’s not present in test is ok.
but it should be possible to override the individual properties in the test code itself, doesn’t matter from where the config is loaded