Пример #1
0
 @Test
 public void statusCode200FromURL() throws Exception {
   FileDownloader downloadHandler = new FileDownloader(driver);
   downloadHandler.setURI(downloadURI200.toURL());
   downloadHandler.setHTTPRequestMethod(RequestMethod.GET);
   assertThat(downloadHandler.getLinkHTTPStatus(), is(equalTo(200)));
 }
Пример #2
0
 @Test
 public void statusCode405FromURLUsingDelete() throws Exception {
   FileDownloader downloadHandler = new FileDownloader(driver);
   downloadHandler.setURI(downloadURI200.toURL());
   downloadHandler.setHTTPRequestMethod(RequestMethod.DELETE);
   assertThat(downloadHandler.getLinkHTTPStatus(), is(equalTo(405)));
 }
Пример #3
0
 @Test
 public void statusCode404FromString() throws Exception {
   FileDownloader downloadHandler = new FileDownloader(driver);
   downloadHandler.setURI(webServerURL + ":" + webServerPort + "/doesNotExist.html");
   downloadHandler.setHTTPRequestMethod(RequestMethod.GET);
   assertThat(downloadHandler.getLinkHTTPStatus(), is(equalTo(404)));
 }
Пример #4
0
 @Test
 public void statusCode404FromURLUsingHead() throws Exception {
   FileDownloader downloadHandler = new FileDownloader(driver);
   downloadHandler.setURI(downloadURI404.toURL());
   downloadHandler.setHTTPRequestMethod(RequestMethod.HEAD);
   assertThat(downloadHandler.getLinkHTTPStatus(), is(equalTo(404)));
 }