Skip to content

Commit

Permalink
testcontainers#291 manual ping
Browse files Browse the repository at this point in the history
  • Loading branch information
bsideup committed Feb 21, 2017
1 parent 60cfc50 commit 71f15d7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import com.google.common.io.ByteStreams;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.jetbrains.annotations.NotNull;

import java.io.*;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.URI;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
Expand Down Expand Up @@ -138,7 +140,11 @@ InetSocketAddress start() throws IOException {
}
return null;
});
return (InetSocketAddress) listenSocket.getLocalSocketAddress();
InetSocketAddress inetSocketAddress = (InetSocketAddress) listenSocket.getLocalSocketAddress();

log.info("Ping: " + IOUtils.toString(URI.create("http://localhost:" + inetSocketAddress.getPort() + "/v1.25/_ping")));

return inetSocketAddress;
}

public void stop() {
Expand Down

0 comments on commit 71f15d7

Please sign in to comment.