The second resolver provided out of the box in JUnit 5 is called RepetitionInfoParameterResolver. Given a test class, if a method parameter in a @RepeatedTest, @BeforeEach, or @AfterEach method is of type RepetitionInfo, the RepetitionInfoParameterResolver will supply an instance of RepetitionInfo.
RepetitionInfo can be used to retrieve information about the current repetition and the total number of repetitions for the corresponding @RepeatedTest. The API of RepetitionInfo offers two methods, as shown in the screenshot after the list:
- int getCurrentRepetition(): Gets the current repetition of the corresponding @RepeatedTest method
- int getTotalRepetitions(): Gets the total number of repetitions of the corresponding ...