close the HTTP client after each test to close idle connections (https://github.com/dropwizard/dropwizard/issues/8174)

This commit is contained in:
Athou
2024-01-06 08:37:12 +01:00
parent 08ab32c4c2
commit 60b6c69020

View File

@@ -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");