Improve testability of new Profiles support [SPR-16962] #21500
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: duplicate
A duplicate of another issue
type: enhancement
A general enhancement
Andy Wilkinson opened SPR-16962 and commented
The introduction of the
Profiles
type in #17063 has made verifying that a call toEnvironment.acceptsProfiles
has been made more difficult. WhenString
was used, verification with Mockito was easy:With the new
Profiles
type this will fail asParsedProfiles
does not overrideequals
:The best that I have come up with is to capture the argument that's passed into
acceptsProfiles
, abusematches
to capture the names of the profiles, and assert that they are as expected:Affects: 5.1 RC1
Issue Links:
@Profile
annotationThe text was updated successfully, but these errors were encountered: