Simplify check

This commit is contained in:
Tadgh 2021-01-18 21:53:14 -05:00
parent edbc789a93
commit 8d87f0f92b
2 changed files with 8 additions and 2 deletions

View File

@ -100,6 +100,11 @@
<artifactId>elasticsearch</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -3,6 +3,7 @@ package ca.uhn.fhir.test.utilities.docker;
import org.junit.jupiter.api.extension.ConditionEvaluationResult;
import org.junit.jupiter.api.extension.ExecutionCondition;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.testcontainers.DockerClientFactory;
import org.testcontainers.elasticsearch.ElasticsearchContainer;
@ -14,7 +15,7 @@ public class DockerRequiredCondition implements ExecutionCondition {
@Override
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext theExtensionContext) {
try {
new ElasticsearchContainer();
DockerClientFactory.instance().isDockerAvailable();
return ConditionEvaluationResult.enabled("Docker is installed so we can run these tests!");
} catch (Exception e) {
return ConditionEvaluationResult.disabled("It appears as though docker is not installed on the host machine!");