summaryrefslogtreecommitdiff
path: root/plugins/repository-azure
diff options
context:
space:
mode:
authorNik Everett <nik9000@gmail.com>2016-07-19 18:31:19 -0400
committerNik Everett <nik9000@gmail.com>2016-07-25 17:02:40 -0400
commita95d4f4ee7e7ada4b1ddec96b8deef140f96c1a7 (patch)
treed27bae9191ee4b72ecd50c187edd905be17bcf5b /plugins/repository-azure
parentb90dff7292b755ca0db0aac6e9a154a527662387 (diff)
Add Location header and improve REST testing
This adds a header that looks like `Location: /test/test/1` to the response for the index/create/update API. The requirement for the header comes from https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html https://tools.ietf.org/html/rfc7231#section-7.1.2 claims that relative URIs are OK. So we use an absolute path which should resolve to the appropriate location. Closes #19079 This makes large changes to our rest test infrastructure, allowing us to write junit tests that test a running cluster via the rest client. It does this by splitting ESRestTestCase into two classes: * ESRestTestCase is the superclass of all tests that use the rest client to interact with a running cluster. * ESClientYamlSuiteTestCase is the superclass of all tests that use the rest client to run the yaml tests. These tests are shared across all official clients, thus the `ClientYamlSuite` part of the name.
Diffstat (limited to 'plugins/repository-azure')
-rw-r--r--plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositoryRestIT.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositoryRestIT.java b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositoryRestIT.java
index ad58838bf5..3c565d407c 100644
--- a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositoryRestIT.java
+++ b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositoryRestIT.java
@@ -21,13 +21,13 @@ package org.elasticsearch.repositories.azure;
import com.carrotsearch.randomizedtesting.annotations.Name;
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
-import org.elasticsearch.test.rest.ESRestTestCase;
+import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase;
import org.elasticsearch.test.rest.RestTestCandidate;
import org.elasticsearch.test.rest.parser.RestTestParseException;
import java.io.IOException;
-public class AzureRepositoryRestIT extends ESRestTestCase {
+public class AzureRepositoryRestIT extends ESClientYamlSuiteTestCase {
public AzureRepositoryRestIT(@Name("yaml") RestTestCandidate testCandidate) {
super(testCandidate);
@@ -35,7 +35,7 @@ public class AzureRepositoryRestIT extends ESRestTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, RestTestParseException {
- return ESRestTestCase.createParameters(0, 1);
+ return ESClientYamlSuiteTestCase.createParameters(0, 1);
}
}