From 6ba081811c40275748087986d5067660c36dfd34 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Wed, 27 Sep 2023 13:03:29 +0100 Subject: [PATCH] Test fixes --- .../xpack/ml/integration/JobResultsProviderIT.java | 4 ++-- .../java/org/elasticsearch/upgrades/MlMappingsUpgradeIT.java | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/JobResultsProviderIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/JobResultsProviderIT.java index a713e7abbf7ca..c3e9bdf1e5f42 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/JobResultsProviderIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/JobResultsProviderIT.java @@ -519,10 +519,10 @@ private Map getIndexMappingProperties(String index) { @SuppressWarnings("unchecked") Map meta = (Map) mappings.get("_meta"); assertThat(meta.keySet(), hasItem("version")); - assertThat(meta.get("version"), equalTo(Build.current().version())); + assertThat(meta.get("version"), equalTo(Build.current().unqualifiedVersion())); assertThat( meta.get("managed_index_mappings_version"), - equalTo(Integer.toString(AnomalyDetectorsIndex.RESULTS_INDEX_MAPPINGS_VERSION)) + equalTo(AnomalyDetectorsIndex.RESULTS_INDEX_MAPPINGS_VERSION) ); @SuppressWarnings("unchecked") diff --git a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/MlMappingsUpgradeIT.java b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/MlMappingsUpgradeIT.java index 95d543a0f63ea..c8eaa9e78f2ef 100644 --- a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/MlMappingsUpgradeIT.java +++ b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/MlMappingsUpgradeIT.java @@ -6,7 +6,6 @@ */ package org.elasticsearch.upgrades; -import org.elasticsearch.Version; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; @@ -131,7 +130,6 @@ private void assertUpgradedResultsMappings() throws Exception { } assertNotNull(indexLevel); - assertEquals(Version.CURRENT.toString(), extractValue("mappings._meta.version", indexLevel)); assertEquals( AnomalyDetectorsIndex.RESULTS_INDEX_MAPPINGS_VERSION, extractValue("mappings._meta.managed_index_mappings_version", indexLevel) @@ -168,7 +166,6 @@ private void assertUpgradedAnnotationsMappings() throws Exception { } assertNotNull(indexLevel); - assertEquals(Version.CURRENT.toString(), extractValue("mappings._meta.version", indexLevel)); assertEquals( AnnotationIndex.ANNOTATION_INDEX_MAPPINGS_VERSION, extractValue("mappings._meta.managed_index_mappings_version", indexLevel) @@ -226,7 +223,6 @@ private void assertUpgradedConfigMappings() throws Exception { Map indexLevel = (Map) responseLevel.get(".ml-config"); assertNotNull(indexLevel); - assertEquals(Version.CURRENT.toString(), extractValue("mappings._meta.version", indexLevel)); assertEquals( MlConfigIndex.CONFIG_INDEX_MAPPINGS_VERSION, extractValue("mappings._meta.managed_index_mappings_version", indexLevel)