Skip to content

Commit 48c0b83

Browse files
committed
BAEL-2454 Add missing disconnect call on open connections
1 parent cdaf0b4 commit 48c0b83

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎core-java/src/test/java/com/baeldung/http/HttpRequestLiveTest.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ public void whenFailedRequest_thenOk() throws IOException {
160160
}
161161
in.close();
162162

163+
con.disconnect();
164+
163165
assertEquals("status code incorrect", status, 411);
164166
assertTrue("error content", content.toString()
165167
.contains("411 - Length Required"));
@@ -176,6 +178,8 @@ public void whenGetRequestFullResponse_thenOk() throws IOException {
176178

177179
String fullResponse = FullResponseBuilder.getFullResponse(con);
178180

181+
con.disconnect();
182+
179183
assertEquals("status code incorrect", con.getResponseCode(), 200);
180184
assertTrue("header incorrect", fullResponse.contains("Content-Type: text/html; charset=UTF-8"));
181185
assertTrue("response incorrect", fullResponse.contains("<!doctype html><html><head>"));

0 commit comments

Comments
 (0)