-
@API(status=STABLE, since="5.0") public interface RepetitionInfo
RepetitionInfo
is used to inject information about the current repetition of a repeated test into@RepeatedTest
,@BeforeEach
, and@AfterEach
methods.If a method parameter is of type
RepetitionInfo
, JUnit will supply an instance ofRepetitionInfo
corresponding to the current repeated test as the value for the parameter.WARNING:
RepetitionInfo
cannot be injected into a@BeforeEach
or@AfterEach
method if the corresponding test method is not a@RepeatedTest
. Any attempt to do so will result in aParameterResolutionException
.- Since:
- 5.0
- See Also:
RepeatedTest
,TestInfo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getCurrentRepetition()
Get the current repetition of the corresponding@RepeatedTest
method.int
getTotalRepetitions()
Get the total number of repetitions of the corresponding@RepeatedTest
method.
-
-
-
Method Detail
-
getCurrentRepetition
int getCurrentRepetition()
Get the current repetition of the corresponding@RepeatedTest
method.
-
getTotalRepetitions
int getTotalRepetitions()
Get the total number of repetitions of the corresponding@RepeatedTest
method.- See Also:
RepeatedTest.value()
-
-