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
Profiles set with @ActiveProfiles are not visible to EnvironmentPostProcessor since 2.5.7 #28739
Comments
@fedortche It is most likely related to #28530. Can you provide a minimal sample that we can run to reproduce the issue? |
@mbhave please check simple test in https://github.com/fedortche/public-sandbox/tree/test-profiles/temp/test-boot-profiles |
Thanks @fedortche. The call to If you need to access the profiles from |
Yes thanks @mbhave, while looking into this I realized that profiles set previously with
|
Hi, the following used to work with Spring Boot 2.5.6 (accessing the properties from
but ignores the test file after upgrading to 2.6.0, most likely related to the current issue. |
@JeromeSimmonds Per what @mbhave has described above, you should be able to set the @SpringBootTest(properties = "spring.profiles.active=test") |
I don't think
In Spring Boot, loading config data is part of "loading an ApplicationContext for test class" so it feels to me like we should get |
@wilkinsona it doesn't work, |
@JeromeSimmonds Your issue sounds slightly different. The reason I suggested |
@wilkinsona I agree. However, I'm not sure how we can make them available to an
|
The
Yes, the indexed values were added to support #19556. One way to get them without using
In this situation, if We discussed it on the team call and decided to leave things as they are, given that there is a workaround to access |
And just in case, make sure, that the profiles you list in
instead of |
After upgrading 2.5.6 to 2.5.7 profiles set with
@ActiveProfiles
annotation on the test class are not visible toEnvironmentPostProcessor
anymore both through environment and application references.Still investigating but probably related to #28530.
The text was updated successfully, but these errors were encountered: