-
-
Couldn't load subscription status.
- Fork 1.6k
Closed
Description
Overview
I wonder if there was really no request for this, but I could find no issue.
With the existing extension APIs, it is possible but clumsy to implement functions like rerunning failing test or things like:
@Test
@ExpectedException(RuntimeException.class)
pulic void testException() {
throw new RuntimeException();
}Something like an AroundEachCallback would be quite helpful. Usage should be something like this:
public class RerunningExtension implements AroundEachCallback {
@Override
public void aroundTestMethod(Executable testIncludingBeforeAndAfter, ExtensionContext context) {
while (cnt++ < getMaxNumberOfExecutions && failureExists) {
try {
failureExists = false;
testIncludingBeforeAndAfter.execute();
} catch (Exception e) {
failureExists = true;
}
}
}
}