use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.
the class DatabaseURIHelperTest method buildDbUri.
@TestTemplate
public void buildDbUri(String path) throws Exception {
URI expected = new URI(uriBase + "/db_name");
URI actual = helper(path + "/db_name").getDatabaseUri();
Assertions.assertEquals(expected, actual);
}
use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.
the class DatabaseURIHelperTest method buildDocumentUri_specialCharsInDocumentId.
@TestTemplate
public void buildDocumentUri_specialCharsInDocumentId(String path) throws Exception {
URI expected = new URI(uriBase + "/test/SDF@%23%25$%23)DFGKLDfdffdg%C3%A9");
URI actual = helper(path + "/test").documentUri("SDF@#%$#)DFGKLDfdffdg\u00E9");
Assertions.assertEquals(expected, actual);
}
use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.
the class DatabaseURIHelperTest method buildDocumentUri_woOptions.
@TestTemplate
public void buildDocumentUri_woOptions(String path) throws Exception {
URI expected = new URI(uriBase + "/test/documentId");
URI actual = helper(path + "/test").documentUri("documentId");
Assertions.assertEquals(expected, actual);
}
use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.
the class DatabaseURIHelperTest method _localDocumentURI.
@TestTemplate
public void _localDocumentURI(String path) throws Exception {
final String expected = uriBase + "/db_name/_local/mylocaldoc";
DatabaseURIHelper helper = helper(path + "/db_name");
URI localDoc = helper.documentUri("_local/mylocaldoc");
Assertions.assertEquals(expected, localDoc.toString());
}
use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.
the class DatabaseURIHelperTest method buildDocumentUri_options_hasPlus.
@TestTemplate
public void buildDocumentUri_options_hasPlus(String path) throws Exception {
URI expected = new URI(uriBase + "/test/path1%2Fpath2?q=class:mammal%2Bwith%2Bplusses");
TreeMap<String, Object> options = new TreeMap<String, Object>();
options.put("q", "class:mammal+with+plusses");
URI actual = helper(path + "/test").documentId("path1/path2").query(options).build();
Assertions.assertEquals(expected, actual);
}
Aggregations