From c47c66362e2c9429931da0ed391f469a4293a0a4 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 8 Aug 2017 15:19:20 -0400 Subject: [PATCH] Fix content type in test I'd left it off. Thanks Jenkins! Original commit: elastic/x-pack-elasticsearch@57b708e4146acc770233e9e2e1274a69e3116c53 --- .../elasticsearch/xpack/restart/FullClusterRestartIT.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java b/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java index 4532f31f0c2..0833d812e35 100644 --- a/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java +++ b/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java @@ -253,12 +253,14 @@ public class FullClusterRestartIT extends ESRestTestCase { assumeTrue("It is only possible to build an index that sql doesn't like before 6.0.0", oldClusterVersion.onOrAfter(Version.V_6_0_0_alpha1)); if (runningAgainstOldCluster) { - client().performRequest("POST", "/testsqlfailsonindexwithtwotypes/type1", emptyMap(), new StringEntity("{}")); - client().performRequest("POST", "/testsqlfailsonindexwithtwotypes/type2", emptyMap(), new StringEntity("{}")); + client().performRequest("POST", "/testsqlfailsonindexwithtwotypes/type1", emptyMap(), + new StringEntity("{}", ContentType.APPLICATION_JSON)); + client().performRequest("POST", "/testsqlfailsonindexwithtwotypes/type2", emptyMap(), + new StringEntity("{}", ContentType.APPLICATION_JSON)); return; } ResponseException e = expectThrows(ResponseException.class, () -> client().performRequest("POST", "/_sql", emptyMap(), - new StringEntity("{\"query\":\"SELECT * FROM testsqlfailsonindexwithtwotypes\"}"))); + new StringEntity("{\"query\":\"SELECT * FROM testsqlfailsonindexwithtwotypes\"}", ContentType.APPLICATION_JSON))); assertEquals(400, e.getResponse().getStatusLine().getStatusCode()); assertThat(e.getMessage(), containsString("Invalid index testsqlfailsonindexwithtwotypes; contains more than one type")); }