I am using Spring Boot, and have a unit test that I want to ignore ALL application.properties
values, and only use values from another file, application-test.properties
I see in a similar question that I can use @TestPropertySource
to point to a test properties file, and I can also use it to override a couple of properties.
I've tried this, but it still seems to load the values from application.properties
as well.
Is there a way to completely ignore application.properties
for a single unit test?
My intent is to run this test with lots of DEFAULT values. I don't want to have to override them in my application-test.properties
file, I want spring to use whatever defaults it has, as if the property was never set in application.properties