quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.83k stars 2.7k forks source link

The only way to verify HttpResponse fluently is deprecated upstream #44612

Closed fedinskiy closed 20 hours ago

fedinskiy commented 21 hours ago

Describe the bug

Currently, if users want to verify HTTP response before processing it, they can use method io.vertx.mutiny.ext.web.client.HttpRequest.expect (the class is automatically generated fromio.vertx.ext.web.client.HttpRequest). Unfortunately, this method is deprecated[1], and documentation recommends to use HttpResponseExpectation together with Vert.X futures. The problem, that futures are not exposed by smallrye api, and Unis, which are used instead, do not have anything corresponding to Future.expecting method. That leaves users without an option to do the verification fluently.

[1] https://github.com/vert-x3/vertx-web/blob/60202842cad48f700441f1c4401fbbd0db48544e/vertx-web-client/src/main/java/io/vertx/ext/web/client/HttpRequest.java#L427

Expected behavior

There should be a supported way to do verification fluently

Actual behavior

The only existing way is deprecated

How to Reproduce?

An example of usage can be seen here:

https://github.com/quarkus-qe/quarkus-test-framework/blob/5f5daa9288cd63d141dba6bdb4ed72b3ff6c0e3b/examples/greetings/src/test/java/io/quarkus/qe/ReactiveGreetingResourceIT.java

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

Not sure whether that should be a bug or a discussion, so please feel free to change its type to the more relevant one.

geoand commented 20 hours ago

cc @vietj @cescoffier

cescoffier commented 20 hours ago

It was deprecated for good reason. We are working on another approach. See: https://github.com/smallrye/smallrye-mutiny-vertx-bindings/pull/1011.

fedinskiy commented 19 hours ago

@cescoffier thank you! Is it possible to put links to this into javadocs for deprecated methods?

cescoffier commented 19 hours ago

The javadoc is extracted from the upstream. We cannot decorate it.