summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2019-07-19 15:05:07 +0200
committerTor Brede Vekterli <vekterli@verizonmedia.com>2019-07-19 15:05:07 +0200
commit76e142fd3b7dd90e6ba0bc9cd85ee83c207aff43 (patch)
tree5dec598e4632675e4643c549fd9d2dc38e7486b5 /vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java
parent2d3c0e73105c65c5d3649b09f79d81a5f97cb661 (diff)
Support `cluster` parameter for Document V1 Get operations
Makes point lookup cluster routing functionality equal to that of visiting operations. Especially useful as the difference between these is minimal when used via the Document V1 REST API.
Diffstat (limited to 'vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java')
-rw-r--r--vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java
index 773d45b6b18..aeddc762586 100644
--- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java
+++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/resource/RestApiTest.java
@@ -288,12 +288,19 @@ public class RestApiTest {
}
@Test
- public void get_fieldset_parameter_is_propagated() throws IOException {
+ public void get_fieldset_parameter_is_propagated() {
Request request = new Request(String.format("http://localhost:%s/document/v1/namespace/document-type/docid/bar?fieldSet=foo,baz", getFirstListenPort()));
HttpGet get = new HttpGet(request.getUri());
assertHttp200ResponseContains(doRest(get), "\"fieldset\":\"foo,baz\"");
}
+ @Test
+ public void get_cluster_parameter_is_propagated() {
+ Request request = new Request(String.format("http://localhost:%s/document/v1/namespace/document-type/docid/bar?cluster=my_cool_cluster", getFirstListenPort()));
+ HttpGet get = new HttpGet(request.getUri());
+ assertHttp200ResponseContains(doRest(get), "\"cluster\":\"my_cool_cluster\"");
+ }
+
String visit_test_uri = "/document/v1/namespace/document-type/docid/?continuation=abc";
String visit_response_part1 = "\"documents\":[List of json docs, cont token abc, doc selection: '']";
String visit_response_part2 = "\"continuation\":\"token\"";