Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
droberts195 committed Sep 27, 2023
1 parent c5be055 commit 6ba0818
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,10 @@ private Map<String, Object> getIndexMappingProperties(String index) {
@SuppressWarnings("unchecked")
Map<String, Object> meta = (Map<String, Object>) 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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -226,7 +223,6 @@ private void assertUpgradedConfigMappings() throws Exception {
Map<String, Object> indexLevel = (Map<String, Object>) 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)
Expand Down

0 comments on commit 6ba0818

Please sign in to comment.