From 18b4733da358eb2c42f2f09cdce19a5a2f4bd0dc Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 16 Apr 2019 13:28:00 -0700 Subject: [PATCH] address review comments --- .../org/elasticsearch/test/AbstractBuilderTestCase.java | 3 +-- .../src/main/java/org/elasticsearch/test/VersionUtils.java | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java index 45a675004bf54..d607d73336826 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java @@ -179,8 +179,7 @@ protected static String createUniqueRandomName() { protected Settings createTestIndexSettings() { // we have to prefer CURRENT since with the range of versions we support it's rather unlikely to get the current actually. - Version indexVersionCreated = randomBoolean() ? Version.CURRENT - : VersionUtils.randomVersionBetween(random(), Version.CURRENT.minimumIndexCompatibilityVersion(), Version.CURRENT); + Version indexVersionCreated = randomBoolean() ? Version.CURRENT : VersionUtils.randomIndexCompatibleVersion(random()); return Settings.builder() .put(IndexMetaData.SETTING_VERSION_CREATED, indexVersionCreated) .build(); diff --git a/test/framework/src/main/java/org/elasticsearch/test/VersionUtils.java b/test/framework/src/main/java/org/elasticsearch/test/VersionUtils.java index 720f4182baf3f..990ae8e1f09a2 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/VersionUtils.java +++ b/test/framework/src/main/java/org/elasticsearch/test/VersionUtils.java @@ -255,11 +255,4 @@ public static Version maxCompatibleVersion(Version version) { public static Version randomIndexCompatibleVersion(Random random) { return randomVersionBetween(random, Version.CURRENT.minimumIndexCompatibilityVersion(), Version.CURRENT); } - - /** - * Returns a random version wire compatible with the current version. - */ - public static Version randomWireCompatibleVersion(Random random) { - return randomVersionBetween(random, Version.CURRENT.minimumCompatibilityVersion(), Version.CURRENT); - } }