Support meta-annotation attr overrides in the TCF #421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this commit, the Spring TestContext Framework (TCF) supported
the use of test-related annotations as meta-annotations for composing
custom test stereotype annotations; however, attributes in custom
stereotypes could not be used to override meta-annotation attributes.
This commit addresses this by allowing attributes from the following
annotations (when used as meta-annotations) to be overridden in custom
stereotypes.
This support depends on functionality provided by
AnnotatedElementUtils. See the 'Notes' below for further details and
ramifications.
Notes:
attribute of an annotation. It is therefore not possible or not
feasible to support meta-annotation attribute overrides for some
test-related annotations.
@ProfileValueSourceConfiguration define single 'value' attributes
which cannot be overridden via Spring's meta-annotation attribute
support.
typical usage scenario involves the 'value' attribute which is not
supported for meta-annotation attribute overrides. Furthermore,
'name' and 'values' are so generic that it is deemed unfeasible to
provide meta-annotation attribute override support for these.
that can be overridden.
provided indirectly via SpringTransactionAnnotationParser.
Implementation Details:
AnnotationAttributes for the described annotation.
root declaring class as well as the declaring class.
AnnotationDescriptor to look up annotation attributes for
@ContextConfiguration and @activeprofiles.
attributes sourced from an instance of AnnotationAttributes.
IllegalStateException if no class in the class hierarchy declares
@ContextHierarchy.
look up annotation attributes for @TransactionConfiguration.
TransactionalTestExecutionListener.
annotation attributes for @timed.
AnnotationDescriptor to look up annotation attributes for
@TestExecutionListeners.
look up annotation attributes for @DirtiesContext.
Issue: SPR-11038