Пример #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 shouldFollowRedirects() {
   Response response = new Request(Verb.GET, "http://bit.ly/whatsup").send();
   assertEquals(200, response.getCode());
   assertTrue(response.getBody().length() > 0);
 }
Пример #3
0
 @Test
 public void shouldReturn200WhenRequestIsOk() {
   Response response = new Request(Verb.GET, "http://www.google.com").send();
   assertEquals(200, response.getCode());
   assertTrue(response.getBody().length() > 0);
 }