Top Description Methods
org.junit.jupiter.api

public Interface RepetitionInfo

Annotations
@API
status:STABLE
since:5.0
Static Imports
org.apiguardian.api.API.Status.MAINTAINED, .API.Status.STABLE

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
RepeatedTest, TestInfo

Method Summary

Modifier and TypeMethod and Description
public int
getCurrentRepetition()

Get the current repetition of the corresponding @RepeatedTest method.

public int
getFailureCount()

Get the current number of repetitions of the corresponding @RepeatedTest method that have ended in a failure.

public int
getFailureThreshold()

Get the configured failure threshold of the corresponding @RepeatedTest method.

public int
getTotalRepetitions()

Get the total number of repetitions of the corresponding @RepeatedTest method.

Method Detail

getCurrentRepetitionback to summary
public int getCurrentRepetition()

Get the current repetition of the corresponding @RepeatedTest method.

getFailureCountback to summary
public int getFailureCount()

Get the current number of repetitions of the corresponding @RepeatedTest method that have ended in a failure.

Annotations
@API
status:MAINTAINED
since:5.13.3
Since
5.10
See Also
getFailureThreshold()
getFailureThresholdback to summary
public int getFailureThreshold()

Get the configured failure threshold of the corresponding @RepeatedTest method.

Annotations
@API
status:MAINTAINED
since:5.13.3
Since
5.10
See Also
RepeatedTest#failureThreshold()
getTotalRepetitionsback to summary
public int getTotalRepetitions()

Get the total number of repetitions of the corresponding @RepeatedTest method.

See Also
RepeatedTest#value