eclipse-vertx / vertx-junit5

Testing Vert.x applications with JUnit 5
Apache License 2.0
44 stars 32 forks source link

Add a convenient way to run assertions on vertx test context #129

Closed liuchong closed 1 year ago

liuchong commented 1 year ago

Motivation:

Assertions will throw exception, so when test fail, it need to wait test context timeout to fail, or it need to wrap try/catch around the assertions. To avoid this, I will to implement a vertx version assertions to call vertx test context fail method on failure.

It's mostly a physical labor job, so I've only provided a very start implements of it, to see if it useful and necessary.

Or, if there a better way to run the tests or too implement this feature?

Further on, if we really need this, we can also implement the methods as instance methods of VertxTestContext, so we could invoke them like testContext.assertEquals(x, y).

liuchong commented 1 year ago

Please have a look when you have time and give your suggestions, thanks! @vietj @tsegismont 👀

tsegismont commented 1 year ago

Or, if there a better way to run the tests or too implement this feature?

It's already possible using TestContext.verify() method: https://vertx.io/docs/vertx-junit5/java/#_use_any_assertion_library