Closed
Description
Status Quo
TestExtensionContext
does not provide access to any exception thrown during execution of the test method or other extensions.
Deliverables
- Reintroduce a
getTestException()
method in theTestExtensionContext
API.- Note: the prototype actually had such a
getTestException()
method.
- Note: the prototype actually had such a
- Ensure that the JUnit Jupiter
TestEngine
infrastructure tracks any exceptions encountered during test method or extension execution and supplies the exception to extensions via theTestExtensionContext
.- Note: it is assumed that the engine already properly tracks the exceptions, but tests need to be introduced to verify the expected behavior.
Further Resources
See the afterEach()
method in the SpringExtension for a concrete example of where the test exception is required.