From 2e064f611cb40b58cceef2d7438445a6962443e6 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Wed, 13 Nov 2024 15:49:22 +0100 Subject: [PATCH] unit test container version latest --- .../elasticsearch/ElasticsearchTestServer.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/java-client/src/test/java/co/elastic/clients/elasticsearch/ElasticsearchTestServer.java b/java-client/src/test/java/co/elastic/clients/elasticsearch/ElasticsearchTestServer.java index 498bce9ae..02e4a0833 100644 --- a/java-client/src/test/java/co/elastic/clients/elasticsearch/ElasticsearchTestServer.java +++ b/java-client/src/test/java/co/elastic/clients/elasticsearch/ElasticsearchTestServer.java @@ -117,11 +117,17 @@ public synchronized ElasticsearchTestServer start() { return this; } - Version version = Version.VERSION.major() < 8 ? new Version(7,17,5,false) : new Version(8,12,0,false); + // using latest snapshot version for generic tests + Version version = Version.VERSION.major() < 8 ? new Version(7, 17, 25, false) : + Version.parse(Version.VERSION.major() + "." + Version.VERSION.minor() + ".0-SNAPSHOT"); - // Note we could use version.major() + "." + version.minor() + "-SNAPSHOT" but plugins won't install on a snapshot version - String esImage = "docker.elastic.co/elasticsearch/elasticsearch:" + version; + // using specific stable version for tests with plugins + if (plugins.length > 0) { + version = Version.VERSION.major() < 8 ? new Version(7, 17, 25, false) : new Version(8, 16, 0, false); + } + String esImage = "docker.elastic.co/elasticsearch/elasticsearch:" + version; + DockerImageName image; if (plugins.length == 0) { image = DockerImageName.parse(esImage);