示例#1
0
 @Test
 public void shouldWorkWithQueryStringParams() {
   Request request =
       new Request(Verb.GET, "http://stackoverflow.com/search?q=oauth+authentication&more=stuff");
   assertEquals(2, request.getQueryStringParams().size());
   assertEquals("http://stackoverflow.com/search", request.getSanitizedUrl());
   Response response = request.send();
   assertEquals(200, response.getCode());
   assertTrue(response.getBody().length() > 0);
 }
示例#2
0
 @Test
 public void shouldSanitizeUrl() {
   Request request =
       new Request(Verb.GET, "http://somewhere/over/the/rainbow?way=up+high&over=the+hills");
   assertEquals("http://somewhere/over/the/rainbow", request.getSanitizedUrl());
 }