diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-01-24 15:05:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-24 15:05:08 +0100 |
commit | 7f61302dd2bd095c3a58babfa1d97fe26dffd5c5 (patch) | |
tree | 09d74e9bbdb8d991213ccb679578e656af44d466 /vespaclient-container-plugin | |
parent | 8496613ba326875d688af6e9b62a9dbc0620ef20 (diff) | |
parent | ae3d728e62bd3ff00ecf14649504aa34773cf63e (diff) |
Merge pull request #1581 from yahoo/balder/failing-test-consecutive-slashes-in-uri
Add a failing unit test for consecutive slahes in uri
Diffstat (limited to 'vespaclient-container-plugin')
-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..b2a8200b4e1 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%3a%2f%2fvn.news.yahoo.com%2fgi-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")); + } + } |