Hi I am using Spring Boot, I want to inject the values of the .yml file in the Bean. I have written the integration test case but looks like via Integration test case it not
Here's how I got it to work:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(initializers=ConfigFileApplicationContextInitializer.class)
public class MyTestClass {
@Autowired
private ConfigurableApplicationContext c;
@Test
public void myTestMethod() {
String value = c.getEnvironment().getProperty("myapp.property")
...
}
}