File tree Expand file tree Collapse file tree
vertx-core/src/test/java/io/vertx/tests/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111package io .vertx .tests .http ;
1212
1313import io .vertx .core .buffer .Buffer ;
14+
1415import io .vertx .core .http .HttpClientOptions ;
1516import io .vertx .core .http .HttpClientResponse ;
1617import io .vertx .core .http .HttpMethod ;
@@ -135,15 +136,14 @@ public void testHttpsProxy_Http2Origin_tunnelled() throws Exception {
135136 .setTrustOptions (Trust .SERVER_JKS .get ())
136137 .setProxyOptions (httpsProxy (proxy .port ())));
137138
138- HttpClientResponse resp = client .request (new RequestOptions ().setMethod (HttpMethod .GET )
139+ String result = client .request (new RequestOptions ().setMethod (HttpMethod .GET )
139140 .setHost (DEFAULT_HTTPS_HOST ).setPort (DEFAULT_HTTPS_PORT ).setURI ("/" ))
140141 .compose (req -> req .send ().expecting (HttpResponseExpectation .SC_OK ))
142+ .compose (resp -> resp .body ().map (body -> resp .version () + ":" + body ))
141143 .await ();
142- Buffer body = resp .body ().await ();
143144
144- assertEquals ("Hello from origin" , body .toString ());
145- assertEquals (HttpVersion .HTTP_2 , resp .version ());
146145 // h2 rides the CONNECT tunnel for free; ALPN negotiates h2 end-to-end with the origin.
146+ assertEquals (HttpVersion .HTTP_2 + ":Hello from origin" , result );
147147 assertEquals (HttpMethod .CONNECT , proxy .getLastMethod ());
148148 }
149149
You can’t perform that action at this time.
0 commit comments