title: @SpringBootTest not using test properties
body: <p>I am using jasypt for encrypting application.properties in a Spring Boot application. My goal is to update my integration tests so that jasypt is used with test encryptor password. My problem is that my test is not overriding the test properties. </p>
  
  <p>Dependencies:</p>
  
  <pre><code>        &lt;dependency&gt;
              &lt;groupId&gt;com.github.ulisesbocchio&lt;/groupId&gt;
              &lt;artifactId&gt;jasypt-spring-boot-starter&lt;/artifactId&gt;
              &lt;version&gt;3.0.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter-api&lt;/artifactId&gt;
              &lt;version&gt;${junit-jupiter.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;
              &lt;version&gt;${junit-jupiter.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;de.flapdoodle.embed&lt;/groupId&gt;
              &lt;artifactId&gt;de.flapdoodle.embed.mongo&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>I have two application.properties, one in <em>src/main/resources/application.properties</em> and another in src/test/application-test.properties. In the test property I am setting jasypt.encryptor.password=test and I override the spring.data.mongodb.uri with the jasypt ENC value using the test password.
  My test looks like this:</p>
  
  <pre><code>import org.junit.jupiter.api.Test;
  import org.junit.jupiter.api.extension.ExtendWith;
  import org.springframework.boot.test.context.SpringBootTest;
  import org.springframework.test.context.ActiveProfiles;
  import org.springframework.test.context.TestPropertySource;
  import org.springframework.test.context.junit.jupiter.SpringExtension;
  
  
  @ExtendWith(SpringExtension.class)
  @SpringBootTest
  @ActiveProfiles("test")
  @TestPropertySource("classpath:application-test.properties")
  public class SpringBootAppTest{
  
  
      @Test
      public void shouldLoadContext(){
          //nothing to test
      }
  }
  
  </code></pre>
  
  <p>As you can see, I am using JUnit5 for my Spring Boot test. I've tried multiple ways of writing this test with custom test properties, but I get the same exception: </p>
  
  <pre><code>Unable to decrypt: ENC(JsHRQaQN0cuHgrq/0o ...)
  
  </code></pre>
  
  <p>The value it's the spring.data.mongodb.uri property value from src/main/resources/application.properties not the value from application-test.properties. What am I doing wrong and how can I override my "main" properties with the test properties? </p>