Package org.junit.jupiter.api
Interface RepetitionInfo
-
@API(status=STABLE, since="5.0") public interface RepetitionInfoRepetitionInfois used to inject information about the current repetition of a repeated test into@RepeatedTest,@BeforeEach, and@AfterEachmethods.If a method parameter is of type
RepetitionInfo, JUnit will supply an instance ofRepetitionInfocorresponding to the current repeated test as the value for the parameter.WARNING:
RepetitionInfocannot be injected into a@BeforeEachor@AfterEachmethod 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 intgetCurrentRepetition()Get the current repetition of the corresponding@RepeatedTestmethod.intgetFailureCount()Get the current number of repetitions of the corresponding@RepeatedTestmethod that have ended in a failure.intgetFailureThreshold()Get the configured failure threshold of the corresponding@RepeatedTestmethod.intgetTotalRepetitions()Get the total number of repetitions of the corresponding@RepeatedTestmethod.
-
-
-
Method Detail
-
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:
RepeatedTest.value()
-
getFailureCount
@API(status=MAINTAINED, since="5.13.3") int getFailureCount()Get the current number of repetitions of the corresponding@RepeatedTestmethod that have ended in a failure.- Since:
- 5.10
- See Also:
getFailureThreshold()
-
getFailureThreshold
@API(status=MAINTAINED, since="5.13.3") int getFailureThreshold()Get the configured failure threshold of the corresponding@RepeatedTestmethod.- Since:
- 5.10
- See Also:
RepeatedTest.failureThreshold()
-
-