Skip to content

Commit

Permalink
fix (jkube-kit/common) : Don't use IoUtil.getFreeRandomPort for TestH…
Browse files Browse the repository at this point in the history
…ttpStaticServer

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
  • Loading branch information
rohanKanojia authored and manusa committed Dec 19, 2023
1 parent 53b9150 commit 32b53d2
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.util.concurrent.TimeoutException;

import static org.eclipse.jkube.kit.common.util.AsyncUtil.async;
import static org.eclipse.jkube.kit.common.util.IoUtil.getFreeRandomPort;

public class TestHttpStaticServer implements Closeable {

Expand All @@ -53,8 +52,7 @@ public void close() throws IOException {

private static Callable<HttpServer> startServer(File staticDirectory) {
return () -> {
final int port = getFreeRandomPort();
final HttpServer ret = HttpServer.create(new InetSocketAddress(port), 0);
final HttpServer ret = HttpServer.create(new InetSocketAddress(0), 0);
ret.createContext("/", exchange -> {
final String path = exchange.getRequestURI().getPath();
final File file = new File(staticDirectory, path).getCanonicalFile();
Expand Down

0 comments on commit 32b53d2

Please sign in to comment.