BAEL-3745: Implement PropertySourceFactory to load YAML files (new module) (#9307)

This commit is contained in:
kwoyke
2020-05-17 12:59:16 +02:00
committed by GitHub
parent 44a1ec0195
commit 832b32210c
7 changed files with 146 additions and 0 deletions
@@ -0,0 +1,23 @@
package com.baeldung.properties.yaml;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest
public class YamlFooPropertiesIntegrationTest {
@Autowired
private YamlFooProperties yamlFooProperties;
@Test
public void whenFactoryProvidedThenYamlPropertiesInjected() {
assertThat(yamlFooProperties.getName()).isEqualTo("foo");
assertThat(yamlFooProperties.getAliases()).containsExactly("abc", "xyz");
}
}