title: SpringBootTest: how to use application-test.yaml and inherit missing values from application.yaml
body: <p>I am trying to run an integration test using the annotations :</p>
  
  <p><code>@RunWith(SpringRunner.class)
   @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) 
   @ActiveProfiles({ "test" })</code>.</p>
  
  <p>The problem I have is that the application loads by using the spring profile "test"
  I have two config files:
  application.yaml
  application-test.yaml</p>
  
  <p>application.yaml contains:</p>
  
  <pre><code>xyz:
    list:
    - class-name: com.any.prod.ClassName1
      jndi-name: com/ws/ClassName1
    - class-name: com.any.prod.ClassName2
      jndi-name: com/ws/ClassName2
  </code></pre>
  
  <p>and the other file doesn't contain these values.
  these valuer are used by a library that i use, and not directly by my application.</p>
  
  <p>when I load the test with the "test" profile enabled the values from application.yaml are not picked up. If I add the same values to application-test.yaml they are picked up during the binding process.</p>
  
  <p>These are the properties that are picked up:</p>
  
  <pre><code>xyz.list[0].class-name: com.any.prod.ClassName1 (loaded from application-test.yaml)
  xyz.list[0].jndi-name: com/ws/ClassName1 (loaded from application-test.yaml)
  xyz.list[1].class-name: com.any.prod.ClassName2 (loaded from application-test.yaml)
  xyz.list[1].jndi-name: com/ws/ClassName2 (loaded from application-test.yaml)
  xyz.list (loaded from application.yaml)
  </code></pre>
  
  <p>Unfortunately the last entry makes the validation of the properties fail.
  Does anyone has in mind what can I do to solve this mystery?
  At this point my understanding of how configuration yaml files are wrong (at least for the testing case - inheritance appears to be working just fine when we deploy our app)</p>