Package org.junit.jupiter.params
Class ParameterizedTestInvocationContext
- java.lang.Object
-
- org.junit.jupiter.params.ParameterizedTestInvocationContext
-
- All Implemented Interfaces:
TestTemplateInvocationContext
class ParameterizedTestInvocationContext extends java.lang.Object implements TestTemplateInvocationContext
- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object[]argumentsprivate ParameterizedTestNameFormatterformatterprivate ParameterizedTestMethodContextmethodContext
-
Constructor Summary
Constructors Constructor Description ParameterizedTestInvocationContext(ParameterizedTestNameFormatter formatter, ParameterizedTestMethodContext methodContext, java.lang.Object[] arguments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Extension>getAdditionalExtensions()Get the additional extensions for this invocation.java.lang.StringgetDisplayName(int invocationIndex)Get the display name for this invocation.
-
-
-
Field Detail
-
formatter
private final ParameterizedTestNameFormatter formatter
-
methodContext
private final ParameterizedTestMethodContext methodContext
-
arguments
private final java.lang.Object[] arguments
-
-
Constructor Detail
-
ParameterizedTestInvocationContext
ParameterizedTestInvocationContext(ParameterizedTestNameFormatter formatter, ParameterizedTestMethodContext methodContext, java.lang.Object[] arguments)
-
-
Method Detail
-
getDisplayName
public java.lang.String getDisplayName(int invocationIndex)
Description copied from interface:TestTemplateInvocationContextGet the display name for this invocation.The supplied
invocationIndexis 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
invocationIndexwrapped in brackets — for example,[1],[42], etc.- Specified by:
getDisplayNamein interfaceTestTemplateInvocationContext- Parameters:
invocationIndex- the index of this invocation (1-based).- Returns:
- the display name for this invocation; never
nullor blank
-
getAdditionalExtensions
public java.util.List<Extension> getAdditionalExtensions()
Description copied from interface:TestTemplateInvocationContextGet 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:
getAdditionalExtensionsin interfaceTestTemplateInvocationContext- Returns:
- the additional extensions for this invocation; never
nullor containingnullelements, but potentially empty
-
-