Skip to content

Commit acad7c8

Browse files
committed
Read body before await in testSendOpenRangeFileFromClasspath
1 parent 2b8895f commit acad7c8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

vertx-core/src/test/java/io/vertx/tests/http/sendfile/HttpSendFileTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,13 @@ public void testSendOpenRangeFileFromClasspath() throws Exception {
191191
res.response().sendFile("hosts_config.txt", 13);
192192
});
193193
startServer(testAddress);
194-
Buffer body = client.request(requestOptions)
194+
String body = client.request(requestOptions)
195195
.compose(HttpClientRequest::send)
196196
.expecting(that(resp -> assertEquals(String.valueOf(10), resp.headers().get("Content-Length"))))
197-
.compose(HttpClientResponse::body)
197+
.compose(resp -> resp.body())
198+
.map(Buffer::toString)
198199
.await();
199-
assertThat(body.toString())
200+
assertThat(body)
200201
.startsWith("server.net")
201202
.hasSize(10);
202203
}

0 commit comments

Comments
 (0)