-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
I have a custom written extension with a CloseableResource in the ExtensionContext. When the resource throws an exception while attempting to close it, exceptions thrown in the test are swallowed. In my specific case there is too little information in the exception thrown in the close-method because it could be a follow-up problem from the exception thrown in the test. Therefore i need to see both exceptions in the test-result.
Steps to reproduce
@ExtendWith(MyExtension.class)
class TestExceptionInExtension {
@Test
void test() {
throw new RuntimeException("Exception in Test.");
}
}
class MyExtension implements BeforeEachCallback {
private static final ExtensionContext.Namespace NAMESPACE = ExtensionContext.Namespace.create(MyExtension.class);
@Override
public void beforeEach(ExtensionContext context) {
context.getStore(NAMESPACE).put("myResource", (ExtensionContext.Store.CloseableResource) () -> {
throw new RuntimeException("Exception in Extension.");
});
}
}Context
- Used versions (Jupiter): 5.8.0-M1
- Build Tool/IDE: IntelliJ IDEA 2020.3.2
rweisleder