summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
Diffstat (limited to 'qa')
-rw-r--r--qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/IndexingIT.java6
-rw-r--r--qa/smoke-test-http/src/test/java/org/elasticsearch/http/DetailedErrorsDisabledIT.java3
-rw-r--r--qa/smoke-test-http/src/test/java/org/elasticsearch/http/DetailedErrorsEnabledIT.java3
3 files changed, 6 insertions, 6 deletions
diff --git a/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/IndexingIT.java b/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/IndexingIT.java
index b5bd18aba5..90a5808710 100644
--- a/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/IndexingIT.java
+++ b/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/IndexingIT.java
@@ -19,6 +19,7 @@
package org.elasticsearch.backwards;
import org.apache.http.HttpHost;
+import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.util.EntityUtils;
import org.elasticsearch.Version;
@@ -70,7 +71,7 @@ public class IndexingIT extends ESRestTestCase {
private void createIndex(String name, Settings settings) throws IOException {
assertOK(client().performRequest("PUT", name, Collections.emptyMap(),
- new StringEntity("{ \"settings\": " + Strings.toString(settings) + " }")));
+ new StringEntity("{ \"settings\": " + Strings.toString(settings) + " }", ContentType.APPLICATION_JSON)));
}
private void updateIndexSetting(String name, Settings.Builder settings) throws IOException {
@@ -85,13 +86,14 @@ public class IndexingIT extends ESRestTestCase {
for (int i = 0; i < numDocs; i++) {
final int id = idStart + i;
assertOK(client().performRequest("PUT", index + "/test/" + id, emptyMap(),
- new StringEntity("{\"test\": \"test_" + id + "\"}")));
+ new StringEntity("{\"test\": \"test_" + id + "\"}", ContentType.APPLICATION_JSON)));
}
return numDocs;
}
public void testSeqNoCheckpoints() throws Exception {
Nodes nodes = buildNodeAndVersions();
+ assumeFalse("new nodes is empty", nodes.getNewNodes().isEmpty());
logger.info("cluster discovered: {}", nodes.toString());
final String bwcNames = nodes.getBWCNodes().stream().map(Node::getNodeName).collect(Collectors.joining(","));
Settings.Builder settings = Settings.builder()
diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/DetailedErrorsDisabledIT.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/DetailedErrorsDisabledIT.java
index 2cf681e9e5..51dbad22de 100644
--- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/DetailedErrorsDisabledIT.java
+++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/DetailedErrorsDisabledIT.java
@@ -24,7 +24,6 @@ import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase.Scope;
@@ -54,7 +53,7 @@ public class DetailedErrorsDisabledIT extends HttpSmokeTestCase {
fail("request should have failed");
} catch(ResponseException e) {
Response response = e.getResponse();
- assertThat(response.getHeader("Content-Type"), is("application/json"));
+ assertThat(response.getHeader("Content-Type"), is("application/json; charset=UTF-8"));
assertThat(EntityUtils.toString(e.getResponse().getEntity()), is("{\"error\":\"error traces in responses are disabled.\"}"));
assertThat(response.getStatusLine().getStatusCode(), is(400));
}
diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/DetailedErrorsEnabledIT.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/DetailedErrorsEnabledIT.java
index cd3cf1a38d..d0b80595a2 100644
--- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/DetailedErrorsEnabledIT.java
+++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/DetailedErrorsEnabledIT.java
@@ -22,7 +22,6 @@ package org.elasticsearch.http;
import org.apache.http.util.EntityUtils;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
-import org.elasticsearch.test.ESIntegTestCase;
import java.io.IOException;
import java.util.Collections;
@@ -52,7 +51,7 @@ public class DetailedErrorsEnabledIT extends HttpSmokeTestCase {
fail("request should have failed");
} catch(ResponseException e) {
Response response = e.getResponse();
- assertThat(response.getHeader("Content-Type"), containsString("application/json"));
+ assertThat(response.getHeader("Content-Type"), containsString("application/json; charset=UTF-8"));
assertThat(EntityUtils.toString(response.getEntity()),
not(containsString("\"stack_trace\":\"[Validation Failed: 1: index / indices is missing;]; "
+ "nested: ActionRequestValidationException[Validation Failed: 1:")));