Module org.junit.jupiter.engine
Class RepeatedTestInvocationContext
java.lang.Object
org.junit.jupiter.engine.extension.RepeatedTestInvocationContext
- All Implemented Interfaces:
TestTemplateInvocationContext
TestTemplateInvocationContext
for a @RepeatedTest
.- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final RepeatedTestDisplayNameFormatter
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionRepeatedTestInvocationContext
(int currentRepetition, int totalRepetitions, RepeatedTestDisplayNameFormatter formatter) -
Method Summary
Modifier and TypeMethodDescriptionGet the additional extensions for this invocation.getDisplayName
(int invocationIndex) Get the display name for this invocation.
-
Field Details
-
currentRepetition
private final int currentRepetition -
totalRepetitions
private final int totalRepetitions -
formatter
-
-
Constructor Details
-
RepeatedTestInvocationContext
public RepeatedTestInvocationContext(int currentRepetition, int totalRepetitions, RepeatedTestDisplayNameFormatter formatter)
-
-
Method Details
-
getDisplayName
Description copied from interface:TestTemplateInvocationContext
Get the display name for this invocation.The supplied
invocationIndex
is incremented by the framework with each test invocation. Thus, in the case of multiple active providers, only the first active provider receives indices starting with1
.The default implementation returns the supplied
invocationIndex
wrapped in brackets — for example,[1]
,[42]
, etc.- Specified by:
getDisplayName
in interfaceTestTemplateInvocationContext
- Parameters:
invocationIndex
- the index of this invocation (1-based).- Returns:
- the display name for this invocation; never
null
or blank
-
getAdditionalExtensions
Description copied from interface:TestTemplateInvocationContext
Get the additional extensions for this invocation.The extensions provided by this method will only be used for this invocation of the test template. Thus, it does not make sense to return an extension that acts solely on the container level (e.g.
BeforeAllCallback
).The default implementation returns an empty list.
- Specified by:
getAdditionalExtensions
in interfaceTestTemplateInvocationContext
- Returns:
- the additional extensions for this invocation; never
null
or containingnull
elements, but potentially empty
-