diff --git a/jetty-ee9/test-ee9-sessions/test-ee9-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/GCloudSessionTestSupport.java b/jetty-ee9/test-ee9-sessions/test-ee9-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/GCloudSessionTestSupport.java index bf497afa4cd8..4c68315db6b2 100644 --- a/jetty-ee9/test-ee9-sessions/test-ee9-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/GCloudSessionTestSupport.java +++ b/jetty-ee9/test-ee9-sessions/test-ee9-gcloud-sessions/src/test/java/org/eclipse/jetty/gcloud/session/GCloudSessionTestSupport.java @@ -47,7 +47,6 @@ import org.slf4j.LoggerFactory; import org.testcontainers.containers.DatastoreEmulatorContainer; import org.testcontainers.containers.output.Slf4jLogConsumer; -import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -65,28 +64,10 @@ public class GCloudSessionTestSupport private static final Logger LOGGER = LoggerFactory.getLogger(GCloudSessionTestSupport.class); private static final Logger GCLOUD_LOG = LoggerFactory.getLogger("org.eclipse.jetty.gcloud.session.gcloudLogs"); - public DatastoreEmulatorContainer emulator = new CustomDatastoreEmulatorContainer( + public DatastoreEmulatorContainer emulator = new DatastoreEmulatorContainer( DockerImageName.parse("gcr.io/google.com/cloudsdktool/cloud-sdk:316.0.0-emulators") - ).withLogConsumer(new Slf4jLogConsumer(GCLOUD_LOG)); - - private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("gcr.io/google.com/cloudsdktool/cloud-sdk"); - - private static final String CMD = "gcloud beta emulators datastore start --project test-project --host-port 0.0.0.0:8081 --consistency=1.0"; - private static final int HTTP_PORT = 8081; - - public static class CustomDatastoreEmulatorContainer extends DatastoreEmulatorContainer - { - public CustomDatastoreEmulatorContainer(DockerImageName dockerImageName) - { - super(dockerImageName); - - dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME); - - withExposedPorts(HTTP_PORT); - setWaitStrategy(Wait.forHttp("/").forStatusCode(200)); - withCommand("/bin/sh", "-c", CMD); - } - } + ).withLogConsumer(new Slf4jLogConsumer(GCLOUD_LOG)) + .withFlags("--consistency=1.0"); public static class TestGCloudSessionDataStoreFactory extends GCloudSessionDataStoreFactory { diff --git a/pom.xml b/pom.xml index 0f1faac29fcb..6262a28f808c 100644 --- a/pom.xml +++ b/pom.xml @@ -93,7 +93,9 @@ 3.5.0 2.0.5 2.1.1.RELEASE - 1.17.5 + 1.2.5 + 1.2.5 + 1.17.6 4.0.3.Final 1.6.0.Final 2.0.0.Final diff --git a/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/session/GCloudSessionDistributionTests.java b/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/session/GCloudSessionDistributionTests.java index 800112894e9b..0a974fa6f6af 100644 --- a/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/session/GCloudSessionDistributionTests.java +++ b/tests/test-distribution/test-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/session/GCloudSessionDistributionTests.java @@ -23,7 +23,6 @@ import org.slf4j.LoggerFactory; import org.testcontainers.containers.DatastoreEmulatorContainer; import org.testcontainers.containers.output.Slf4jLogConsumer; -import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; /** @@ -36,30 +35,12 @@ public class GCloudSessionDistributionTests extends AbstractSessionDistributionT private static final Logger GCLOUD_LOG = LoggerFactory.getLogger("org.eclipse.jetty.tests.distribution.session.gcloudLogs"); public DatastoreEmulatorContainer emulator = - new CustomDatastoreEmulatorContainer(DockerImageName.parse("gcr.io/google.com/cloudsdktool/cloud-sdk:316.0.0-emulators")) - .withLogConsumer(new Slf4jLogConsumer(GCLOUD_LOG)); - - private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("gcr.io/google.com/cloudsdktool/cloud-sdk"); - - private static final String CMD = "gcloud beta emulators datastore start --project test-project --host-port 0.0.0.0:8081 --consistency=1.0"; - private static final int HTTP_PORT = 8081; + new DatastoreEmulatorContainer(DockerImageName.parse("gcr.io/google.com/cloudsdktool/cloud-sdk:316.0.0-emulators")) + .withLogConsumer(new Slf4jLogConsumer(GCLOUD_LOG)) + .withFlags("--consistency=1.0"); String host; - public static class CustomDatastoreEmulatorContainer extends DatastoreEmulatorContainer - { - public CustomDatastoreEmulatorContainer(DockerImageName dockerImageName) - { - super(dockerImageName); - - dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME); - - withExposedPorts(HTTP_PORT); - setWaitStrategy(Wait.forHttp("/").forStatusCode(200)); - withCommand("/bin/sh", "-c", CMD); - } - } - @Override public void startExternalSessionStorage() throws Exception {