I\'m using a spring boot app which runs my src/main/resources/config/application.yml.
When I run my test case by :
@RunWith(SpringJUnit4ClassRunner.c
A simple working configuration using
@TestPropertySource and properties
@SpringBootTest @RunWith(SpringJUnit4ClassRunner.class) @TestPropertySource(properties = {"spring.config.location=classpath:another.yml"}) public class TestClass { @Test public void someTest() { } }