eclipse-vertx / vertx-junit5

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

Similar to run on context, but to run on Virtual Thread. #139

Open cristian-joseb opened 1 month ago

cristian-joseb commented 1 month ago

Describe the feature

Have a class to run unit test using Virtual Thread

Use cases

Provide the ability to write sync unit test, in today scenario it is not possible to call Future.await in a unit test.

Contribution

Who should implement this feature ? are you volunteering for implementing this feature or do you know that is able and willing implement this feature ?

yes, I can implement it.

tsegismont commented 1 month ago

@cristian-joseb thanks for suggesting this.

Rather than adding a class, I think we could have a io.vertx.core.ThreadingModel parameter in the RunOnContext constructor.

And then, instead of always creating an event loop context, we use the value of this parameter to decided the type of context that must be created.

Thoughts?

If you're willing to send a PR, I'd be glad to review.

cristian-joseb commented 1 month ago

Yes, makes sense I will open the PR shortly