Fix content type in test

I'd left it off. Thanks Jenkins!

Original commit: elastic/x-pack-elasticsearch@57b708e414
This commit is contained in:
Nik Everett 2017-08-08 15:19:20 -04:00
parent 4c7e02191f
commit c47c66362e
1 changed files with 5 additions and 3 deletions

View File

@ -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", 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)); oldClusterVersion.onOrAfter(Version.V_6_0_0_alpha1));
if (runningAgainstOldCluster) { if (runningAgainstOldCluster) {
client().performRequest("POST", "/testsqlfailsonindexwithtwotypes/type1", emptyMap(), new StringEntity("{}")); client().performRequest("POST", "/testsqlfailsonindexwithtwotypes/type1", emptyMap(),
client().performRequest("POST", "/testsqlfailsonindexwithtwotypes/type2", emptyMap(), new StringEntity("{}")); new StringEntity("{}", ContentType.APPLICATION_JSON));
client().performRequest("POST", "/testsqlfailsonindexwithtwotypes/type2", emptyMap(),
new StringEntity("{}", ContentType.APPLICATION_JSON));
return; return;
} }
ResponseException e = expectThrows(ResponseException.class, () -> client().performRequest("POST", "/_sql", emptyMap(), 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()); assertEquals(400, e.getResponse().getStatusLine().getStatusCode());
assertThat(e.getMessage(), containsString("Invalid index testsqlfailsonindexwithtwotypes; contains more than one type")); assertThat(e.getMessage(), containsString("Invalid index testsqlfailsonindexwithtwotypes; contains more than one type"));
} }