From 1f00008d15a1c1a050533d5685eee9712e367a39 Mon Sep 17 00:00:00 2001 From: Tim Vernum Date: Fri, 8 Feb 2019 14:24:10 +1100 Subject: [PATCH] Only "include_type_name" if running on >= 7 In cluster restart tests, we need to "include_type_name" if the cluster includes a pre-7 version, but the test is running against a 7+ version --- .../java/org/elasticsearch/upgrades/FullClusterRestartIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java b/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java index efef77ec5ff63..c97bd808e27a4 100644 --- a/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java +++ b/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java @@ -909,8 +909,8 @@ public void testSnapshotRestore() throws IOException { createTemplateRequest.setJsonEntity(Strings.toString(templateBuilder)); // In 7.0, type names are no longer expected by default in put index template requests. - // We therefore use the deprecated typed APIs when running against the current version. - if (isRunningAgainstAncientCluster()) { + // We therefore use the deprecated typed APIs when running against the current version, but testing with a pre-7 version + if (isRunningAgainstOldCluster() == false && getOldClusterVersion().major < 7) { createTemplateRequest.addParameter(INCLUDE_TYPE_NAME_PARAMETER, "true"); } createTemplateRequest.setOptions(allowTypeRemovalWarnings());