Annotation Type AfterParameterizedClassInvocation
-
@Target({ANNOTATION_TYPE,METHOD}) @Retention(RUNTIME) @Documented @API(status=MAINTAINED, since="5.13.3") public @interface AfterParameterizedClassInvocation@AfterParameterizedClassInvocationis used to signal that the annotated method should be executed before each invocation of the current@ParameterizedClass.Declaring
@AfterParameterizedClassInvocationmethods in a regular, non-parameterized test class has no effect and will be ignored.Method Signatures
@AfterParameterizedClassInvocationmethods must have avoidreturn type, must not be private, and must bestaticby default. Consequently,@AfterParameterizedClassInvocationmethods are not supported in@Nestedtest classes or as interface default methods unless the test class is annotated with@TestInstance(Lifecycle.PER_CLASS). However, beginning with Java 16@AfterParameterizedClassInvocationmethods may be declared asstaticin@Nestedtest classes, in which case theLifecycle.PER_CLASSrestriction no longer applies.Method Arguments
@AfterParameterizedClassInvocationmethods may optionally declare parameters that are resolved depending on the setting of theinjectArguments()attribute.If
injectArguments()is set tofalse, the parameters must be resolved by other registeredParameterResolvers.If
injectArguments()is set totrue(the default), the method must declare the same parameters, in the same order, as the indexed parameters (see@ParameterizedClass) of the parameterized test class. It may declare a subset of the indexed parameters starting from the first argument. Additionally, the method may declare custom aggregator parameters (see@ParameterizedClass) at the end of its parameter list. If the method declares additional parameters after these aggregator parameters, or more parameters than the class has indexed parameters, they may be resolved by otherParameterResolvers.For example, given a
@ParameterizedClasswith indexed parameters of typeintandString, the following method signatures are valid:{@code- Since:
- 5.13
- See Also:
ParameterizedClass,BeforeParameterizedClassInvocation,TestInstance
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleaninjectArgumentsWhether the arguments of the parameterized test class should be injected into the annotated method (defaults totrue).
-