diff --git a/boot-opensearch-sample/docker/docker-compose.yml b/boot-opensearch-sample/docker/docker-compose.yml index 1edb0c219..ab6465df7 100644 --- a/boot-opensearch-sample/docker/docker-compose.yml +++ b/boot-opensearch-sample/docker/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.8' services: opensearch: - image: opensearchproject/opensearch:1.1.0 + image: opensearchproject/opensearch:1.3.12 container_name: opensearch hostname: opensearch ports: @@ -14,7 +14,7 @@ services: - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" opensearch-dashboards: - image: opensearchproject/opensearch-dashboards:1.1.0 + image: opensearchproject/opensearch-dashboards:1.3.12 container_name: opensearch_dashboards ports: - "5601:5601" diff --git a/boot-opensearch-sample/src/test/java/com/example/opensearch/common/ContainersConfig.java b/boot-opensearch-sample/src/test/java/com/example/opensearch/common/ContainersConfig.java index f0c2a6b64..8fbe817d6 100644 --- a/boot-opensearch-sample/src/test/java/com/example/opensearch/common/ContainersConfig.java +++ b/boot-opensearch-sample/src/test/java/com/example/opensearch/common/ContainersConfig.java @@ -1,32 +1,19 @@ package com.example.opensearch.common; -import java.net.HttpURLConnection; -import java.time.Duration; import org.springframework.boot.test.context.TestConfiguration; import org.springframework.test.context.DynamicPropertyRegistry; import org.springframework.test.context.DynamicPropertySource; import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.wait.strategy.HttpWaitStrategy; @TestConfiguration(proxyBeanMethods = false) public class ContainersConfig { static final GenericContainer openSearchContainer = - new GenericContainer<>("opensearchproject/opensearch:1.1.0") + new GenericContainer<>("opensearchproject/opensearch:1.3.12") .withEnv("discovery.type", "single-node") .withEnv("DISABLE_SECURITY_PLUGIN", "true") .withEnv("OPENSEARCH_JAVA_OPTS", "-Xms512m -Xmx512m") - .withExposedPorts(9200, 9600) - .waitingFor( - new HttpWaitStrategy() - .forPort(9200) - .forStatusCodeMatching( - response -> - response == HttpURLConnection.HTTP_OK - || response - == HttpURLConnection - .HTTP_UNAUTHORIZED) - .withStartupTimeout(Duration.ofMinutes(4))); + .withExposedPorts(9200, 9600); static { openSearchContainer.start();