Module org.junit.jupiter.engine
Class RepetitionInfoParameterResolver
java.lang.Object
org.junit.jupiter.engine.extension.RepetitionInfoParameterResolver
- All Implemented Interfaces:
Extension
,ParameterResolver
- Since:
- 5.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionRepetitionInfoParameterResolver
(int currentRepetition, int totalRepetitions) -
Method Summary
Modifier and TypeMethodDescriptionresolveParameter
(ParameterContext parameterContext, ExtensionContext extensionContext) Resolve an argument for theParameter
in the suppliedParameterContext
for the suppliedExtensionContext
.boolean
supportsParameter
(ParameterContext parameterContext, ExtensionContext extensionContext) Determine if this resolver supports resolution of an argument for theParameter
in the suppliedParameterContext
for the suppliedExtensionContext
.
-
Field Details
-
currentRepetition
private final int currentRepetition -
totalRepetitions
private final int totalRepetitions
-
-
Constructor Details
-
RepetitionInfoParameterResolver
public RepetitionInfoParameterResolver(int currentRepetition, int totalRepetitions)
-
-
Method Details
-
supportsParameter
public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) Description copied from interface:ParameterResolver
Determine if this resolver supports resolution of an argument for theParameter
in the suppliedParameterContext
for the suppliedExtensionContext
.The
Method
orConstructor
in which the parameter is declared can be retrieved viaParameterContext.getDeclaringExecutable()
.- Specified by:
supportsParameter
in interfaceParameterResolver
- Parameters:
parameterContext
- the context for the parameter for which an argument should be resolved; nevernull
extensionContext
- the extension context for theExecutable
about to be invoked; nevernull
- Returns:
true
if this resolver can resolve an argument for the parameter- See Also:
-
resolveParameter
public RepetitionInfo resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) Description copied from interface:ParameterResolver
Resolve an argument for theParameter
in the suppliedParameterContext
for the suppliedExtensionContext
.This method is only called by the framework if
ParameterResolver.supportsParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext)
previously returnedtrue
for the sameParameterContext
andExtensionContext
.The
Method
orConstructor
in which the parameter is declared can be retrieved viaParameterContext.getDeclaringExecutable()
.- Specified by:
resolveParameter
in interfaceParameterResolver
- Parameters:
parameterContext
- the context for the parameter for which an argument should be resolved; nevernull
extensionContext
- the extension context for theExecutable
about to be invoked; nevernull
- Returns:
- the resolved argument for the parameter; may only be
null
if the parameter type is not a primitive - See Also:
-