Skip to content

Commit

Permalink
Avoid hanging tests, see dropwizard/dropwizard#8176 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratrun committed Aug 10, 2024
1 parent 0d3be2c commit cad2c68
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import io.dropwizard.testing.junit5.DropwizardAppExtension;

import jakarta.ws.rs.client.WebTarget;
import org.apache.hc.core5.http.ConnectionReuseStrategy;
import org.glassfish.jersey.apache5.connector.Apache5ClientProperties;

/**
* @author thomas aulinger
Expand All @@ -31,6 +33,7 @@ private TestUtils() {

public static WebTarget clientTarget(DropwizardAppExtension<? extends Configuration> app, String path) {
path = prefixPathWithSlash(path);
app.client().property(Apache5ClientProperties.REUSE_STRATEGY, (ConnectionReuseStrategy) (request, response, context) -> false);
return app.client().target(clientUrl(app, path));
}

Expand Down

0 comments on commit cad2c68

Please sign in to comment.