use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.
the class DatabaseURIHelperTest method buildDocumentUri_options_encodeSeparators.
@TestTemplate
public void buildDocumentUri_options_encodeSeparators(String path) throws Exception {
URI expected = new URI(uriBase + "/test/path1%2Fpath2?d%26etail%3D=%26%3D%3Dds%26&revs=%5B1-2%5D");
TreeMap<String, Object> options = new TreeMap<String, Object>();
options.put("revs", "[1-2]");
options.put("d&etail=", "&==ds&");
URI actual = helper(path + "/test").documentId("path1/path2").query(options).build();
Assertions.assertEquals(expected, actual);
}
use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.
the class DatabaseURIHelperTest method buildChangesUri_woOptions.
@TestTemplate
public void buildChangesUri_woOptions(String path) throws Exception {
URI expected = new URI(uriBase + "/test/_changes");
URI actual = helper(path + "/test").changesUri(new HashMap<String, Object>());
Assertions.assertEquals(expected, actual);
}
use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.
the class DatabaseURIHelperTest method buildDocumentUri_colonInDocumentId.
@TestTemplate
public void buildDocumentUri_colonInDocumentId(String path) throws Exception {
URI expected = new URI(uriBase + "/test/:this:has:colons:");
URI actual = helper(path + "/test").documentUri(":this:has:colons:");
Assertions.assertEquals(expected, actual);
}
use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.
the class DatabaseURIHelperTest method buildChangesUri_options_optionsEncoded.
@TestTemplate
public void buildChangesUri_options_optionsEncoded(String path) throws Exception {
URI expected = new URI(uriBase + "/test/_changes?limit=100&since=%22%5B%5D%22");
Map<String, Object> options = new HashMap<String, Object>();
options.put("since", "\"[]\"");
options.put("limit", 100);
URI actual = helper(path + "/test").changesUri(options);
Assertions.assertEquals(expected, actual);
}
use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.
the class DatabaseURIHelperTest method buildBulkDocsUri.
@TestTemplate
public void buildBulkDocsUri(String path) throws Exception {
URI expected = new URI(uriBase + "/test/_bulk_docs");
URI actual = helper(path + "/test").bulkDocsUri();
Assertions.assertEquals(expected, actual);
}
Aggregations