diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java index a54ea46e7b2..8fb4af4dfd9 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java @@ -114,7 +114,7 @@ public class HttpExporterTemplateTests extends AbstractExporterTemplateTestCase switch (requestLine) { // Cluster version case "GET / HTTP/1.1": - return newResponse(200, "{\"version\": {\"number\": \"" + Version.CURRENT.number() + "\"}}"); + return newResponse(200, "{\"version\": {\"number\": \"" + Version.CURRENT.toString() + "\"}}"); // Bulk case "POST /_bulk HTTP/1.1": // Parse the bulk request and extract all index names diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java index 493f9fac281..d4af10437c8 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java @@ -430,7 +430,7 @@ public class HttpExporterTests extends MarvelIntegTestCase { Version resolved = exporter.loadRemoteClusterVersion(host); assertTrue(resolved.equals(Version.CURRENT)); - final Version expected = randomFrom(Version.CURRENT, Version.V_0_18_0, Version.V_1_1_0, Version.V_1_2_5, + final Version expected = randomFrom(Version.CURRENT, Version.V_0_18_0, Version.V_1_1_0, Version.V_1_2_4, Version.V_1_4_5, Version.V_1_6_0); enqueueGetClusterVersionResponse(expected); resolved = exporter.loadRemoteClusterVersion(host); @@ -475,7 +475,7 @@ public class HttpExporterTests extends MarvelIntegTestCase { private void enqueueGetClusterVersionResponse(MockWebServer mockWebServer, Version v) throws IOException { mockWebServer.enqueue(new MockResponse().setResponseCode(200).setBody( - jsonBuilder().startObject().startObject("version").field("number", v.number()).endObject().endObject().bytes().toUtf8())); + jsonBuilder().startObject().startObject("version").field("number", v.toString()).endObject().endObject().bytes().toUtf8())); } private void enqueueResponse(int responseCode, String body) throws IOException { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/support/VersionUtilsTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/support/VersionUtilsTests.java index c598f55edcd..6f0590efaca 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/support/VersionUtilsTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/support/VersionUtilsTests.java @@ -17,9 +17,9 @@ public class VersionUtilsTests extends ESTestCase { public void testParseVersion() { List versions = randomSubsetOf(9, Version.V_0_18_0, Version.V_0_19_0, Version.V_1_0_1, Version.V_1_2_3, Version.V_1_3_2, - Version.V_1_4_6, Version.V_1_6_3, Version.V_1_7_2, Version.V_2_0_0); + Version.V_1_4_5, Version.V_1_6_2, Version.V_1_7_2, Version.V_2_0_0); for (Version version : versions) { - String output = createOutput(VersionUtils.VERSION_NUMBER_FIELD, version.number()); + String output = createOutput(VersionUtils.VERSION_NUMBER_FIELD, version.toString()); assertThat(VersionUtils.parseVersion(output.getBytes(StandardCharsets.UTF_8)), equalTo(version)); assertThat(VersionUtils.parseVersion(VersionUtils.VERSION_NUMBER_FIELD, output), equalTo(version)); } diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/rest/action/RestShieldInfoAction.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/rest/action/RestShieldInfoAction.java index 026cc7ad238..34e98ce4c91 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/rest/action/RestShieldInfoAction.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/rest/action/RestShieldInfoAction.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.shield.rest.action; +import org.elasticsearch.Build; import org.elasticsearch.Version; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterName; @@ -64,10 +65,10 @@ public class RestShieldInfoAction extends BaseRestHandler { } builder.field("cluster_name", clusterName.value()); builder.startObject("version") - .field("number", Version.CURRENT.number()) + .field("number", Version.CURRENT.toString()) .field("build_hash", ShieldBuild.CURRENT.hash()) .field("build_timestamp", ShieldBuild.CURRENT.timestamp()) - .field("build_snapshot", Version.CURRENT.snapshot) + .field("build_snapshot", Build.CURRENT.isSnapshot()) .endObject(); builder.field("tagline", "You Know, for Security"); builder.endObject(); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/rest/action/RestWatcherInfoAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/rest/action/RestWatcherInfoAction.java index c714312b10c..c23f5814af7 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/rest/action/RestWatcherInfoAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/rest/action/RestWatcherInfoAction.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.watcher.rest.action; +import org.elasticsearch.Build; import org.elasticsearch.Version; import org.elasticsearch.client.Client; import org.elasticsearch.common.inject.Inject; @@ -39,10 +40,10 @@ public class RestWatcherInfoAction extends WatcherRestHandler { public RestResponse buildResponse(WatcherStatsResponse watcherStatsResponse, XContentBuilder builder) throws Exception { builder.startObject() .startObject("version") - .field("number", Version.CURRENT.number()) + .field("number", Version.CURRENT.toString()) .field("build_hash", watcherStatsResponse.getBuild().hash()) .field("build_timestamp", watcherStatsResponse.getBuild().timestamp()) - .field("build_snapshot", Version.CURRENT.snapshot) + .field("build_snapshot", Build.CURRENT.isSnapshot()) .endObject() .field("tagline", "You Know, for Alerts & Automation") .endObject();