From efb77cf5506148a8caf412ff9c293d2960e13719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Mu=C3=B1oz?= Date: Thu, 14 Mar 2024 16:09:05 +0100 Subject: [PATCH] [SRVLOGIC-253] Skip shouldGetDockerImageName test if no docker (#3440) --- .../kie/kogito/testcontainers/KogitoMongoDBContainerTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kogito-test-utils/src/test/java/org/kie/kogito/testcontainers/KogitoMongoDBContainerTest.java b/kogito-test-utils/src/test/java/org/kie/kogito/testcontainers/KogitoMongoDBContainerTest.java index 03a0b843b62..65122081c4f 100644 --- a/kogito-test-utils/src/test/java/org/kie/kogito/testcontainers/KogitoMongoDBContainerTest.java +++ b/kogito-test-utils/src/test/java/org/kie/kogito/testcontainers/KogitoMongoDBContainerTest.java @@ -20,8 +20,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.testcontainers.DockerClientFactory; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assumptions.assumeTrue; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.spy; @@ -51,6 +53,7 @@ void shouldGetMapperPort() { @Test void shouldGetDockerImageName() { + assumeTrue(DockerClientFactory.instance().isDockerAvailable(), "Aborting test: docker env not found"); assertThat(container.getDockerImageName()).isEqualTo(System.getProperty(Constants.CONTAINER_NAME_PREFIX + KogitoMongoDBContainer.NAME)); } }