Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions test/jdk/java/net/httpclient/http3/H3MalformedResponseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,9 @@ public void testWellFormedResponse(String desc, byte[] response) throws Exceptio
HttpClient client = getHttpClient();
try {
HttpRequest request = getRequest();
final HttpResponse<Void> response1 = client.sendAsync(
final HttpResponse<Void> response1 = client.send(
request,
BodyHandlers.discarding())
.get(10, TimeUnit.SECONDS);
BodyHandlers.discarding());
assertEquals(response1.statusCode(), 200);
assertFalse(errorCF.isDone(), "Expected the connection to be open");
} finally {
Expand All @@ -366,13 +365,10 @@ public void testMalformedResponse(String desc, byte[] response) throws Exception
HttpClient client = getHttpClient();
try {
HttpRequest request = getRequest();
final HttpResponse<Void> response1 = client.sendAsync(
final HttpResponse<Void> response1 = client.send(
request,
BodyHandlers.discarding())
.get(Utils.adjustTimeout(10), TimeUnit.SECONDS);
BodyHandlers.discarding());
fail("Expected the request to fail, got " + response1);
} catch (TimeoutException e) {
throw e;
} catch (Exception e) {
System.out.println("Got expected exception: " +e);
e.printStackTrace();
Expand All @@ -395,13 +391,10 @@ public void testMalformedResponse2(String desc, byte[] response) throws Exceptio
HttpClient client = getHttpClient();
try {
HttpRequest request = getRequest();
final HttpResponse<Void> response1 = client.sendAsync(
final HttpResponse<Void> response1 = client.send(
request,
BodyHandlers.discarding())
.get(10, TimeUnit.SECONDS);
BodyHandlers.discarding());
fail("Expected the request to fail, got " + response1);
} catch (TimeoutException e) {
throw e;
} catch (Exception e) {
System.out.println("Got expected exception: " +e);
e.printStackTrace();
Expand Down