Justin Knowles opened SPR-14378 and commented
@TestPropertySource allows you to set test-suite / class-level properties, but I want test-level properties so I can test drive classes with @ConditionalOnProperty and @Value(${var:default}) type annotations for correct behavior.
I have considered creating separate test suites for each test, but that seems unnatural. I currently manually manage the context within the test to validate the behavior.
Issue Links:
@ActiveProfiles at method level@ContextConfiguration at method level8 votes, 14 watchers
Seth Wingert commented
This would be really useful for me as well. I'm doing a lot of custom @AutoConfigure and managing different properties between tests is really tricky since @TestPropertySource only works on the class level.
vijay parashar commented
Any timeline for fixing this issue.
Any plans on this? It would be very useful to not having to create a separate class each time an application.properties parameter should change for testing.
We would love to see this aswell
It would be great to have this feature!
Yes, it麓s needed
Yep, 4 years on, I want this too!
Any updates on this? Would really make testing simpler on conditional properties...
Bump
I need this too!!
Most helpful comment
Any plans on this? It would be very useful to not having to create a separate class each time an application.properties parameter should change for testing.