Update x-pack to elastic/elasticsearchelastic/elasticsearch#16740

Original commit: elastic/x-pack-elasticsearch@63a3f49730
This commit is contained in:
Simon Willnauer 2016-02-20 17:21:47 -08:00
parent 7b2fae3982
commit 64e4ccf9a0
5 changed files with 11 additions and 9 deletions

View File

@ -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

View File

@ -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 {

View File

@ -17,9 +17,9 @@ public class VersionUtilsTests extends ESTestCase {
public void testParseVersion() {
List<Version> 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));
}

View File

@ -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();

View File

@ -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();