Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use in combination with other assertion frameworks #54

Closed
jotak opened this issue Dec 22, 2017 · 7 comments
Closed

Allow to use in combination with other assertion frameworks #54

jotak opened this issue Dec 22, 2017 · 7 comments
Milestone

Comments

@jotak
Copy link
Contributor

jotak commented Dec 22, 2017

It would be nice to use VertxUnit in combination with other assertion frameworks, such as assertj.

As I understand, it essentially means that async "completeness" must be handled on assertion errors.

So I suggest to add a method in TestContext such as void run(Runnable r) that takes any piece of code (which may contain assertions using another assertion framework), catches AssertionError and use the TestContext fail method.

@jotak
Copy link
Contributor Author

jotak commented Dec 22, 2017

PS: I'm writing a PR

@vietj
Copy link
Contributor

vietj commented Dec 22, 2017

can you take inspiration from vertx-junit 5 that provides a new verify method on VertxTestContext ? it would be good to have the same API in both project.

@jotak
Copy link
Contributor Author

jotak commented Dec 22, 2017

Indeed it looks exactly the same as what I'm writing, except the method name, so I'll call it verify as well.

@jotak
Copy link
Contributor Author

jotak commented Dec 22, 2017

@vietj , Runnable is not allowed? It's used in the junit5 module, but in vertx-unit I get:

[ERROR] diagnostic: /work/vertx-unit/src/main/java/io/vertx/ext/unit/TestContext.java:212: error: Could not generate model for io.vertx.ext.unit.TestContext#verify(java.lang.Runnable): type java.lang.Runnable is not legal for use for a parameter in code generation
  TestContext verify(Runnable block);

@jotak
Copy link
Contributor Author

jotak commented Dec 22, 2017

(I could use Handler<Void> , but it would have an unused parameter)

@vietj
Copy link
Contributor

vietj commented Jan 8, 2018

Handler is the polyglot way to go

@vietj
Copy link
Contributor

vietj commented Jan 8, 2018

so it's fine

@vietj vietj added this to the 3.5.1 milestone Jan 8, 2018
@vietj vietj closed this as completed Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants