New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
application-test.properties ignored after upgrading to Spring Boot 2.6.0 (maybe 2.5.7) #28853
Comments
@JeromeSimmonds As @mbhave requested, can you please share a small sample that we can run that reproduces the problem? You can share it with us by zipping it up and attaching it this issue or by pushing it to a separate repository on GitHub. |
It's going to take me some time to extract the minimum code required from my project to be able to share here (the code I already shared could be added to any Spring Boot project though...), in the meantime can you folks confirm that using those annotations
still overrides the |
Not able to reproduce with Spring Boot 2.6.1 https://github.com/antti-markus-cko/issuedemo |
@antti-markus-cko have you tested with the |
@antti-markus-cko so I tested your project after moving the file to the test folder and it still works. |
This sort of thing is why we really need a minimal example that reproduces the problem. Unfortunately, we can't investigate a problem that is vague. |
My team is experiencing this same issue, we upgraded from Spring Boot 2.4.6 to Spring Boot 2.4.13. The problem is not 100% guaranteed to happen. Sometimes it will load the application-test.yml file and other times it will apparently ignore it. We are using maven, when I clean the project and let IntelliJ build my integration test project that has the application-test.yml and the tests that utilize it, it appears to be happy, however, when I maven install then it appears to ignore the file. At least, that is what I noticed this morning. |
Additional update, we are copying resources from a different location into our integration tests. ${basedir}/../resources/src/main/resourceSo this may have broken for us a while ago and we just didn't notice until more recently. However, adding another testResoruce for the current projects resources places the file in place so it can be loaded. Not sure if this is the same problem the original poster is having as well. |
@antti-markus-cko @wilkinsona latest update: so the Actuator I understand the problem now, thank you for trying to help! |
@JeromeSimmonds Correct, the info contributor that exposes every property in the environment that begins with |
Hi, the following used to work with Spring Boot 2.5.6 (accessing the properties from
src/test/resources/application-test.properties
)but ignores the test properties file after upgrading to 2.6.0: the value for
appName
is the one from the defaultapplication.properties
.What do we need to change to make the properties from
src/test/resources/application-test.properties
override the default ones, as it used to do?PS: I have been told this problem appeared with SB 2.5.7 but I haven't tested.
The text was updated successfully, but these errors were encountered: