title: Spring Boot Test: @TestPropertySource not overriding @EnableAutoConfiguration
body: <p>I am using Spring Data LDAP to get user data from an LDAP server.</p>
  
  <p>My file structure looks like this:</p>
  
  <pre><code>main
    java
      com.test.ldap
        Application.java
        Person.java
        PersonRepository.java
    resources
      application.yml
      schema.ldif
  
  test
    java
      Tests.java
    resources
      test.yml
      test_schema.ldif
  </code></pre>
  
  <p>And here is my test class:</p>
  
  <pre><code>import com.test.ldap.Person;
  import com.test.ldap.PersonRepository;
  import org.junit.Test;
  import org.junit.runner.RunWith;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.boot.test.context.SpringBootTest;
  import org.springframework.test.context.TestPropertySource;
  import org.springframework.test.context.junit4.SpringRunner;
  
  import java.util.List;
  
  @RunWith(SpringRunner.class)
  @SpringBootTest(classes = {PersonRepository.class})
  @TestPropertySource(locations = "classpath:test.yml")
  @EnableAutoConfiguration
  public class Tests {
  
      @Autowired
      private PersonRepository personRepository;
  
      @Test
      public void testGetPersonByLastName() {
          List&lt;Person&gt; names = personRepository.getPersonNamesByLastName("Bachman");
          assert(names.size() &gt; 0);
      }
  
  }
  </code></pre>
  
  <p>The problem is, Spring Boot is loading the <code>application.yml</code> and <code>schema.ldif</code> files instead of my test YAML and LDIF files, despite the fact that my <code>@TestPropertySource</code> annotation is explicitly listing <code>test.yml</code>. This seems to be due to the auto configuration, which I would prefer to use for convenience.</p>
  
  <p>I would expect <code>@TestPropertySource</code> to take higher precedence than the auto configuration, but that does not seem to be the case. Is this a bug in Spring, or am I misunderstanding something?</p>
  
  <p>For the record, here is my <code>test.yml</code> file (it does specify <code>test_schema.ldif</code>):</p>
  
  <pre><code>spring:
    ldap:
      # Embedded Spring LDAP
      embedded:
        base-dn: dc=test,dc=com
        credential:
          username: uid=admin
          password: secret
        ldif: classpath:test_schema.ldif
        port: 12345
        validation:
          enabled: false
  </code></pre>