zigarn commented on code in PR #12434:
URL: https://github.com/apache/kafka/pull/12434#discussion_r933310878


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/RestServerTest.java:
##########
@@ -166,19 +173,21 @@ public void testOptionsDoesNotIncludeWadlOutput() throws 
IOException {
 
         HttpOptions request = new HttpOptions("/connectors");
         request.addHeader("Content-Type", MediaType.WILDCARD);
-        CloseableHttpClient httpClient = HttpClients.createMinimal();
-        HttpHost httpHost = new HttpHost(
-            server.advertisedUrl().getHost(),
-            server.advertisedUrl().getPort()
-        );
-        CloseableHttpResponse response = httpClient.execute(httpHost, request);
-        Assert.assertEquals(MediaType.TEXT_PLAIN, 
response.getEntity().getContentType().getValue());
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        response.getEntity().writeTo(baos);
-        Assert.assertArrayEquals(
-            request.getAllowedMethods(response).toArray(),
-            new String(baos.toByteArray(), StandardCharsets.UTF_8).split(", ")
-        );
+        try (CloseableHttpClient httpClient = HttpClients.createMinimal()) {

Review Comment:
   Right, went a bit too far in the try-with-resources implementation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to