Package rife.bld.extension.testing
Annotation Interface RetryTest
JUnit annotation to mark a test method for retry on failure.
When a test fails, it will be retried up to the specified number of times. Optionally, a wait period can be specified between retry attempts.
This annotation automatically includes the RetryExtension, so no additional
@ExtendWith annotation is required.
Usage examples:
@RetryTest(3)
void unstableTest() {
// Test code that might fail intermittently
}
@RetryTest(value = 5, delay = 2)
void testWithDelay() {
// Test that waits 2 seconds between retry attempts
}- Since:
- 1.0
- Author:
- Erik C. Thauvin
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
delay
int delayThe number of seconds to wait between retry attempts.If set to
0(default), no wait occurs between retries. This can be useful for tests that interact with external systems that may need time to recover or stabilize.- Returns:
- the wait time in seconds between retry attempts
- Default:
- 0
-
name
String nameOptional name for the test template. If not specified, a default name will be generated.- Returns:
- the display name for the retry test template
- Default:
- ""
-
value
int valueThe maximum number of retry attempts for a failing test.The test will be executed at most
value()times after the initial failure.- Returns:
- the number of retry attempts. Must be greater than 0
- Default:
- 3
-