zigarn commented on code in PR #12434:
URL: https://github.com/apache/kafka/pull/12434#discussion_r933377429
##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/RestServerTest.java:
##########
@@ -64,17 +70,34 @@ public class RestServerTest {
private Herder herder;
private Plugins plugins;
private RestServer server;
+ private CloseableHttpClient httpClient;
+ private Collection<CloseableHttpResponse> responses = new ArrayList<>();
protected static final String KAFKA_CLUSTER_ID = "Xbafgnagvar";
@Before
public void setUp() {
herder = mock(Herder.class);
plugins = mock(Plugins.class);
+ httpClient = HttpClients.createMinimal();
}
@After
public void tearDown() {
+ responses.stream().forEach(response -> {
+ try {
+ response.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
Review Comment:
A bit more complicated to correctly close everything but still raising
errors.
Or we could just fail everything on first closing issue?
Added commit for 1st option. Can go for a fail-fast option if you prefer.
--
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]