I have a spring boot project and it works great. Now I want to write tests for my application, and I came across some configuration head heads.
Spring boot created a test class for me called ApplicationTests. It is very simple and looks like this:
@RunWith(SpringRunner.class) @SpringBootTest public class DuurzaamApplicationTests { @Test public void contextLoads() { } }
Now when I run the tests, I get this error:
java.lang.IllegalArgumentException: Could not resolve placeholder 'company.upload' in value "${company.upload}"
I have a properties.yml file in the src / test / resources directory and for some reason it is not loaded. I tried all kinds of annotations from examples on the Internet, and yet none of them work.
How can I tell spring boot tests to use the application.yml file to load properties from?
source share