Closed slinkydeveloper closed 4 years ago
My two cents:
ServiceLoader
mechanismWebClient
injection, we still need vertx-web-client types for the assertions. I don't want to "abandon" the dream of having focused assertions for vertx APIs, because it's a really useful feature for us and for users. Since other packages in future could join the assertions "party" the problem will raise again. But at this point I think It would be wise if single packages ships it, so web-client (maybe not with the production jar) should ship it.can we have the vertx-junit5 extension for rx to be in vertx-rx project ?
ping
Let me think about it 🎶
I think moving the Rx-generated packages and modules to vertx-rx
is the right thing to break circular dependencies.
Now the good question is how to keep VertxExtension
the single point for the extension. Technically we could have a VertxRx2Extension
, etc, but that wouldn't be so great.
So we need some pluggable mechanism for the types that can be injected. Thus we'd need a factory loaded through an SPI, right? 😉 The the VertxExtension
would load these factories / types, and inject. What gets injected would then be what is on the class/module path.
...and in this case the webclient module is separate, but vertx-junit5 should not depend on it, it should just be a submodule in Maven parlance.
It's a non-trivial refactoring, basically it looks like we need to rewrite all VertxExtension
internals around a flexible design to instanciate parameters to be injected.
I believe we need an SPI to discover "injectable types" (e.g., Vertx
, WebClient
, VertxTestContext
, etc). The difficult points are that these objects need to be scoped (because you can have nested tests and such), they need to be closed (vertx.close()
), and intialization requires parameters (e.g., WebClient
needs to locate a matching Vertx
instance, etc).
See #74 (work-in-progress)
All done 🎉
In order to allow using
vertx-junit5
for testing packages in vertx stack,vertx-junit5
(parent and childs) should depend only onvertx-core
.This issue blocks the release of vertx-web-validation, vertx-web-api-service and vertx-web-openapi, because it introduces circular dependencies: https://github.com/vert-x3/vertx-web/commit/690b6a4a9f06e891b4bc60cf2f13c3a0dd24761d
This issue is composed by: