Skip to content

Instantly share code, notes, and snippets.

@neotyk
Created December 28, 2013 23:59
Show Gist options
  • Save neotyk/8165807 to your computer and use it in GitHub Desktop.
Save neotyk/8165807 to your computer and use it in GitHub Desktop.
diff --git api/src/test/java/org/asynchttpclient/async/RequestBuilderTest.java api/src/test/java/org/asynchttpclient/async/RequestBuilderTest.java
index 586b74a..a2ced7a 100644
--- api/src/test/java/org/asynchttpclient/async/RequestBuilderTest.java
+++ api/src/test/java/org/asynchttpclient/async/RequestBuilderTest.java
@@ -74,6 +74,16 @@ public class RequestBuilderTest {
}
@Test(groups = {"standalone", "default_provider"})
+ public void testAddQueryParameterReadRawUrl() throws UnsupportedEncodingException {
+ RequestBuilder rb = new RequestBuilder("GET", true).setUrl("http://example.com/path")
+ .addQueryParameter("a", "1?&")
+ .addQueryParameter("b", "+ =");
+ Request request = rb.build();
+ assertEquals(request.getUrl(), "http://example.com/path?a=1%3F%26&b=%2B%20%3D");
+ assertEquals(request.getRawUrl(), "http://example.com/path?a=1?&&b=+ =");
+ }
+
+ @Test(groups = {"standalone", "default_provider"})
public void testChaining() throws IOException, ExecutionException, InterruptedException {
Request request = new RequestBuilder("GET")
.setUrl("http://foo.com")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment