ElasticQueryAdapter: Move isV6 method to ElasticVersion and simplify

Move isV6 to ElasticVersion and simplify it to make it work with all
future 6.x versions, ratehr than being hard-coded to 6.2 and 6.3.

Add a test.

Change-Id: Ibd17a45ebbcbbc8edcd37c8aec37090d878ebdf4
This commit is contained in:
David Pursehouse
2018-09-04 08:47:36 +09:00
parent 1ee03aa948
commit 088f2d438a
3 changed files with 13 additions and 6 deletions

View File

@@ -46,4 +46,11 @@ public class ElasticVersionTest {
"Invalid version: [4.0.0]. Supported versions: " + ElasticVersion.supportedVersions());
ElasticVersion.forVersion("4.0.0");
}
@Test
public void version6() throws Exception {
assertThat(ElasticVersion.V6_2.isV6()).isTrue();
assertThat(ElasticVersion.V6_3.isV6()).isTrue();
assertThat(ElasticVersion.V5_6.isV6()).isFalse();
}
}