title: application-test.properties isn't loaded when activating profiles with <profiles>
body: <p>I'm trying to use <a href="http://docs.spring.io/spring-boot/docs/1.3.0.RELEASE/maven-plugin/examples/run-profiles.html" rel="nofollow">new feature from Spring Boot 1.3.0.RELEASE</a> -- activate profile via configuration of <code>spring-boot-maven-plugin</code>:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
      &lt;configuration&gt;
          &lt;profiles&gt;
              &lt;profile&gt;test&lt;/profile&gt;
          &lt;/profiles&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;start-application&lt;/id&gt;
              &lt;goals&gt;
                  &lt;goal&gt;start&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
              &lt;id&gt;stop-application&lt;/id&gt;
              &lt;goals&gt;
                  &lt;goal&gt;stop&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>But in this case my integration test starts to fail, because of <code>IllegalArgumentException: Could not resolve placeholder 'spring.mail.host' in string value "${spring.mail.host}"</code></p>
  
  <p>This variable defined in <code>src/main/resources/application-test.properties</code>:</p>
  
  <pre><code>spring.profiles: test
  spring.mail.host: 127.0.0.1
  </code></pre>
  
  <p>My test look like this:</p>
  
  <pre><code>@ContextConfiguration(
      loader = AnnotationConfigContextLoader.class,
      initializers = ConfigFileApplicationContextInitializer.class,
      classes = TestContext.class
  )
  public class WhenAnonymousUserRegisterAccount extends AbstractTestNGSpringContextTests {
  
      @Value("${spring.mail.host}")
      private String mailHost;
  </code></pre>
  
  <p><code>TestContext</code> only defines <code>PropertySourcesPlaceholderConfigurer</code> with another property files.</p>
  
  <p>The interesting part is that if I remove <code>&lt;profiles&gt;</code> and activate profile from <code>application.properties</code> my test works:</p>
  
  <pre><code>spring.profiles.active: test
  </code></pre>
  
  <p>So, it looks like that when I'm using <code>&lt;profiles&gt;</code> Spring doesn't load <code>application-test.properties</code> file to the environment.</p>
  
  <p>Questions:</p>
  
  <ul>
  <li>is it a bug?</li>
  <li>(if it's not) how to configure Spring to load <code>application-test.properties</code> and use <code>&lt;profiles&gt;</code>?</li>
  <li>why these approaches are differ?</li>
  </ul>