eclipse-vertx / vertx-junit5

Testing Vert.x applications with JUnit 5
Apache License 2.0
42 stars 30 forks source link

An exception detected by VertxTestContext is not being informed to Junit5's ExtensionContext object in an beforeAll method #86

Open cvgaviao opened 4 years ago

cvgaviao commented 4 years ago

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.

jponge commented 3 years ago

Thanks for the report.

Would you have a reproducer to highlight the problem?