Search in sources :

Example 51 with TestTemplate

use of org.junit.jupiter.api.TestTemplate in project java-cloudant by cloudant.

the class DatabaseURIHelperTest method buildEscapedDbUri.

// this test shows that non-ascii characters will be represented correctly
// in the url but that we don't escape characters like /
@TestTemplate
public void buildEscapedDbUri(String path) throws Exception {
    URI expected = new URI(uriBase + "/SDF@%23%25$%23)DFGKLDfdffdg%C3%A9");
    URI actual = helper(path + "/SDF@#%$#)DFGKLDfdffdg\u00E9").getDatabaseUri();
    Assertions.assertEquals(expected.toASCIIString(), actual.toASCIIString());
}
Also used : URI(java.net.URI) TestTemplate(org.junit.jupiter.api.TestTemplate)

Aggregations

TestTemplate (org.junit.jupiter.api.TestTemplate)51 CloudantClient (com.cloudant.client.api.CloudantClient)23 URI (java.net.URI)18 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)18 MockResponse (okhttp3.mockwebserver.MockResponse)16 HttpConnection (com.cloudant.http.HttpConnection)11 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)7 TreeMap (java.util.TreeMap)5 TestTimer (com.cloudant.tests.util.TestTimer)4 ByteArrayInputStream (java.io.ByteArrayInputStream)4 URL (java.net.URL)4 TooManyRequestsException (com.cloudant.client.org.lightcouch.TooManyRequestsException)3 Replay429Interceptor (com.cloudant.http.interceptors.Replay429Interceptor)3 CouchDbException (com.cloudant.client.org.lightcouch.CouchDbException)2 HttpConnectionInterceptorContext (com.cloudant.http.HttpConnectionInterceptorContext)2 RequiresCloudant (com.cloudant.test.main.RequiresCloudant)2 RequiresCloudantService (com.cloudant.test.main.RequiresCloudantService)2 Gson (com.google.gson.Gson)2 JsonObject (com.google.gson.JsonObject)2 IOException (java.io.IOException)2