title: Spring: Order of profile names with SpringBootTest
body: <p>SpringBoot 2.7.1 with Spring Cloud Config</p>
  <p>I have a test</p>
  <pre><code>@ActiveProfiles({&quot;local&quot;,&quot;h2dbmem&quot;})
  @SpringBootTest(properties = {&quot;server.ssl.enabled=false&quot;})
  @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
  @TestPropertySource(locations = &quot;classpath:application-integrationtest.properties&quot;)
  public class SystemTest {
  ...
  }
  
  </code></pre>
  <p>and I then run Maven to run the test :</p>
  <pre><code> mvn -Dspring.profiles.include=cloudconfig clean verify
  </code></pre>
  <p>When the test runs, the console says :</p>
  <pre><code>The following 3 profiles are active: &quot;cloudconfig&quot;, &quot;local&quot;, &quot;h2dbmem&quot;
  </code></pre>
  <p>Although this is <strong>exactly</strong> what I wanted, that it ends up using the JDBC URL and credentials from the <code>h2dbmem</code> profile and <strong>not</strong> the JDBC URL and credentials from the  <code>cloud-config</code> profile, I could not find documentation on why <code>cloudconfig</code> ( supplied via command-line ) was added as the first entry in the list of active profiles after the profiles supplied via the <code>@ActiveProfiles</code> annotation.</p>
  <p>To be honest, I was actually expecting the following order of profiles :</p>
  <pre><code>The following 3 profiles are active: &quot;local&quot;, &quot;h2dbmem&quot;, &quot;cloudconfig&quot;
  </code></pre>
  <p>... where the JDBC URL and credentials from <code>cloudconfig</code> are used, but I am glad it was not.</p>
  <p>So question is:</p>
  <p>Is there specific documentation on the sequence / order of profiles when they are supplied in multiple ways ( annotation, command-line, etc ) ?</p>
  <p>Note I am aware of the order and sequence / preference of properties, which is not what I am asking.</p>