Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yawkat committed Nov 6, 2024
1 parent b1ff6c4 commit bdc3762
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@
import io.micronaut.http.HttpResponse;
import io.micronaut.http.client.BlockingHttpClient;
import io.micronaut.http.client.HttpClient;
import io.micronaut.http.client.HttpClientConfiguration;
import io.micronaut.http.poja.test.TestingServerlessEmbeddedApplication;
import io.micronaut.http.tck.ServerUnderTest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URI;
import java.util.Map;
import java.util.Optional;

Expand Down Expand Up @@ -61,14 +59,7 @@ public PojaApacheServerUnderTest(Map<String, Object> properties) {
.orElseThrow(() -> new IllegalStateException("TestingServerlessApplication bean is required"));
application.start();
port = application.getPort();
try {
client = HttpClient.create(
new URL("http://localhost:" + port),
applicationContext.getBean(HttpClientConfiguration.class)
).toBlocking();
} catch (MalformedURLException e) {
throw new RuntimeException("Could not create HttpClient", e);
}
client = applicationContext.createBean(HttpClient.class, URI.create("http://localhost:" + port)).toBlocking();
}

@Override
Expand Down

0 comments on commit bdc3762

Please sign in to comment.