Skip to content

Commit

Permalink
fix: should also work in the absence of injection
Browse files Browse the repository at this point in the history
  • Loading branch information
metacosm committed Mar 1, 2024
1 parent 3f859f3 commit 770ac91
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public class ServerSampler implements Sampler {
@ConfigProperty(name = "power-server.url", defaultValue = "http://localhost:20432")
URI powerServerURI;

private static final URI DEFAULT_URI = URI.create("http://localhost:20432");

public ServerSampler(URI powerServerURI) {
if (powerServerURI != null) {
this.powerServerURI = powerServerURI;
}
this.powerServerURI = powerServerURI != null ? powerServerURI : DEFAULT_URI;
final var client = ClientBuilder.newClient();
client.register(new ClientJacksonMessageBodyReader(new ObjectMapper()));
base = client.target(this.powerServerURI.resolve("power"));
Expand Down

0 comments on commit 770ac91

Please sign in to comment.