BAEL-3756-Spring-YAML-vs-Properties (#9482)

* Remove Dockerfile because it is not longer needed in the article

* Add different YAML configurations and process into POJO

* Remove .dockerignore file because it is not longer needed in the article

* Add default Spring profile to test and force also in the Unit tests
This commit is contained in:
Carlos Cavero
2020-06-12 19:40:14 +02:00
committed by GitHub
parent 3a99a52d11
commit edd28c1b43
6 changed files with 161 additions and 30 deletions
@@ -11,6 +11,7 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = MyApplication.class)
@TestPropertySource(properties = {"spring.profiles.active = test"})
class YAMLIntegrationTest {
@Autowired
@@ -20,5 +21,6 @@ class YAMLIntegrationTest {
void whenProfileTest_thenNameTesting() {
assertTrue("testing".equalsIgnoreCase(config.getEnvironment()));
assertTrue("test-YAML".equalsIgnoreCase(config.getName()));
assertTrue("myurl".equalsIgnoreCase(config.getComponent().getIdm().getUrl()));
}
}