From 60b6c69020ed67abe81621463a494a7d1816198a Mon Sep 17 00:00:00 2001 From: Athou Date: Sat, 6 Jan 2024 08:37:12 +0100 Subject: [PATCH] close the HTTP client after each test to close idle connections (https://github.com/dropwizard/dropwizard/issues/8174) --- .../src/test/java/com/commafeed/integration/BaseIT.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/commafeed-server/src/test/java/com/commafeed/integration/BaseIT.java b/commafeed-server/src/test/java/com/commafeed/integration/BaseIT.java index 1219f49b..969f9652 100644 --- a/commafeed-server/src/test/java/com/commafeed/integration/BaseIT.java +++ b/commafeed-server/src/test/java/com/commafeed/integration/BaseIT.java @@ -12,6 +12,7 @@ import org.eclipse.jetty.http.HttpStatus; import org.glassfish.jersey.client.JerseyClientBuilder; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.extension.ExtendWith; @@ -71,6 +72,11 @@ public abstract class BaseIT { this.webSocketUrl = "ws://localhost:" + extension.getLocalPort() + "/ws"; } + @AfterEach + void cleanup() { + this.client.close(); + } + protected String login() { LoginRequest req = new LoginRequest(); req.setName("admin");