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 of RepetitionInfo 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 a
ParameterResolutionException.
- Since:
- 5.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintGet the current repetition of the corresponding@RepeatedTestmethod.intGet the current number of repetitions of the corresponding@RepeatedTestmethod that have ended in a failure.intGet the configured failure threshold of the corresponding@RepeatedTestmethod.intGet the total number of repetitions of the corresponding@RepeatedTestmethod.
-
Method Details
-
getCurrentRepetition
int getCurrentRepetition()Get the current repetition of the corresponding@RepeatedTestmethod. -
getTotalRepetitions
int getTotalRepetitions()Get the total number of repetitions of the corresponding@RepeatedTestmethod.- See Also:
-
getFailureCount
Get the current number of repetitions of the corresponding@RepeatedTestmethod that have ended in a failure.- Since:
- 5.10
- See Also:
-
getFailureThreshold
Get the configured failure threshold of the corresponding@RepeatedTestmethod.- Since:
- 5.10
- See Also:
-