fixed error in staging multidocument integration test

This commit is contained in:
Gerardo Roza 2021-05-08 15:17:56 -03:00
parent 6e02759f10
commit dec59dec95
2 changed files with 8 additions and 3 deletions

View File

@ -15,6 +15,7 @@ spring:
username: SA username: SA
bael: bael:
property: stagingValue property: stagingValue
stagingProperty: stagingPropertyValue
--- ---
application: application:
servers: servers:

View File

@ -18,13 +18,17 @@ public class StagingMultidocumentFilesIntegrationTest {
@Value("${bael.property}") @Value("${bael.property}")
private String baelCustomProperty; private String baelCustomProperty;
@Value("${bael.stagingProperty}")
private String baelStagingProperty;
@Value("${bael.root-level-property}") @Value("${bael.root-level-property}")
private String baelRootProperty; private String baelRootProperty;
@Test @Test
@Disabled("Fix and update https://www.baeldung.com/spring-boot-yaml-vs-properties article")
public void givenProductionProfileActive_whenApplicationStarts_thenDefaultPropertiesUser() { public void givenProductionProfileActive_whenApplicationStarts_thenDefaultPropertiesUser() {
assertThat(baelCustomProperty).isEqualTo("stagingValue"); assertThat(baelStagingProperty).isEqualTo("stagingPropertyValue");
// application.properties is loaded after the application.yml file and overrides the values
assertThat(baelCustomProperty).isEqualTo("defaultValue");
assertThat(baelRootProperty).isEqualTo("defaultRootLevelValue"); assertThat(baelRootProperty).isEqualTo("defaultRootLevelValue");
} }
} }