What am I doing wrong? I\'m using this little standalone App which runs and finds my src/main/resources/config/application.yml
. The same configuration doesn\'t work
Try this:
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = TestApplication.class,
initializers = ConfigFileApplicationContextInitializer.class)
public class SomeTestClass {
...
}
EDIT:
For Spring Boot version 1.5+, SpringApplicationConfiguration
was removed in favour of SpringBootTest
or direct use of SpringBootContextLoader
.
You can still use initializers
parameter with ContextConfiguration
annotation.