Junit5 allows multiple extensions to work together inside one test class. Those extensions can share data and errors through the ExtensionContext object.
Any extension can use the method extensionContext.getExecutionException().isPresent() to detect when an error have occurred in any of other used extensions and took a properly path. In my case, to prevent the running of an unnecessary code.
The problem I'm facing is when executing a vert.x future inside a beforeAll() method and the test class is using a @TestInstance(Lifecycle.PER_CLASS).
An exception thrown by the future is not being rethrown by the VertxExtension in this case, it is only rethrowing an exception in the joinActiveTestContexts method (not reached in beforeAll methods).
Contribution
I'm willing in providing a PR for this, but I want to be sure if this is desired by the people that are responsible for vertx-junit5 before putting my hands on it.
Describe the feature
Junit5 allows multiple extensions to work together inside one test class. Those extensions can share data and errors through the ExtensionContext object.
Any extension can use the method
extensionContext.getExecutionException().isPresent()
to detect when an error have occurred in any of other used extensions and took a properly path. In my case, to prevent the running of an unnecessary code. The problem I'm facing is when executing a vert.x future inside a beforeAll() method and the test class is using a@TestInstance(Lifecycle.PER_CLASS)
. An exception thrown by the future is not being rethrown by the VertxExtension in this case, it is only rethrowing an exception in the joinActiveTestContexts method (not reached in beforeAll methods).Contribution
I'm willing in providing a PR for this, but I want to be sure if this is desired by the people that are responsible for vertx-junit5 before putting my hands on it.