Class RepetitionInfoParameterResolver
- java.lang.Object
-
- org.junit.jupiter.engine.extension.RepetitionInfoParameterResolver
-
- All Implemented Interfaces:
Extension
,ParameterResolver
class RepetitionInfoParameterResolver extends java.lang.Object implements ParameterResolver
- Since:
- 5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
RepetitionInfoParameterResolver.DefaultRepetitionInfo
-
Field Summary
Fields Modifier and Type Field Description private int
currentRepetition
private int
totalRepetitions
-
Constructor Summary
Constructors Constructor Description RepetitionInfoParameterResolver(int currentRepetition, int totalRepetitions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RepetitionInfo
resolveParameter(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
.
-
-
-
Method Detail
-
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:
ParameterResolver.resolveParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext)
,ParameterContext
-
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:
ParameterResolver.supportsParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext)
,ParameterContext
-
-