diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-01-24 00:11:49 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-01-24 00:11:49 +0100 |
commit | cd81b64daa45831ba99b8d93bdc5a4d33943ee11 (patch) | |
tree | 8bed4dbc0f4f7386085bf3c6a0f138607df0408b /vespaclient-container-plugin/src | |
parent | c0d41268bcd3a33b58ee3dd8561b5ca20f4da1ac (diff) |
Add a failing unit test for consecutive slahes in uri
Diffstat (limited to 'vespaclient-container-plugin/src')
-rw-r--r-- | vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/RestUriTest.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/RestUriTest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/RestUriTest.java index 4bb7a264aba..db1fe220614 100644 --- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/RestUriTest.java +++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/RestUriTest.java @@ -106,4 +106,13 @@ public class RestUriTest { new RestUri(createUri("/document/v1/namespace/doctype/Q/myid", "")); } + @Test + public void testDocIdAsIs() throws Exception { + RestUri restUri = new RestUri(new URI("/document/v1/test/newsarticle/docid/http://vn.news.yahoo.com/gi-th-ng-t-n-ng-khoa-h-205000458.html").normalize()); + assertThat(restUri.getNamespace(), is("test")); + assertThat(restUri.getDocumentType(), is("newsarticle")); + assertThat(restUri.getDocId(), is("http://vn.news.yahoo.com/gi-th-ng-t-n-ng-khoa-h-205000458.html")); + assertThat(restUri.generateFullId(), is("id:test:newsarticle::http://vn.news.yahoo.com/gi-th-ng-t-n-ng-khoa-h-205000458.html")); + } + } |