Skip to content

Commit 299f78c

Browse files
committed
Only run a test if the docker server is running
1 parent bbe871a commit 299f78c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

java/server/test/org/openqa/selenium/docker/BootstrapTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@
2828
import java.io.UncheckedIOException;
2929
import java.net.URI;
3030
import java.net.URISyntaxException;
31+
import java.nio.file.Paths;
3132

3233
import static java.net.HttpURLConnection.HTTP_BAD_REQUEST;
3334
import static java.net.HttpURLConnection.HTTP_INTERNAL_ERROR;
3435
import static java.net.HttpURLConnection.HTTP_NOT_FOUND;
36+
import static java.net.HttpURLConnection.HTTP_OK;
3537
import static org.assertj.core.api.Assertions.assertThat;
38+
import static org.assertj.core.api.Assumptions.assumeThat;
3639
import static org.openqa.selenium.remote.http.Contents.utf8String;
3740
import static org.openqa.selenium.remote.http.HttpMethod.GET;
3841

@@ -80,8 +83,10 @@ public void shouldComplainBitterlyIfNoSupportedVersionOfDockerProtocolIsFound()
8083

8184
@Test
8285
public void foo() throws URISyntaxException {
86+
assumeThat(Paths.get("/var/run/docker.sock")).exists();
87+
8388
HttpClient client = HttpClient.Factory.create("reactor").createClient(ClientConfig.defaultConfig().baseUri(new URI("unix:///var/run/docker.sock")));
8489
HttpResponse res = client.execute(new HttpRequest(GET, "/version"));
85-
System.out.println(res.getStatus());
90+
assertThat(res.getStatus()).isEqualTo(HTTP_OK);
8691
}
8792
}

0 commit comments

Comments
 (0)