[JAVA-32852] Fix UrlCheckerIntegrationTest (#16292)
This commit is contained in:
parent
f82778cc17
commit
aa8016e838
@ -11,28 +11,28 @@ public class UrlCheckerIntegrationTest {
|
||||
@Test
|
||||
public void givenValidUrl_WhenUsingHEAD_ThenReturn200() throws IOException {
|
||||
UrlChecker tester = new UrlChecker();
|
||||
int responseCode = tester.getResponseCodeForURLUsingHead("http://www.example.com");
|
||||
int responseCode = tester.getResponseCodeForURLUsingHead("https://httpbin.org/status/200");
|
||||
assertEquals(200, responseCode);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenInvalidIUrl_WhenUsingHEAD_ThenReturn404() throws IOException {
|
||||
UrlChecker tester = new UrlChecker();
|
||||
int responseCode = tester.getResponseCodeForURLUsingHead("http://www.example.com/xyz");
|
||||
int responseCode = tester.getResponseCodeForURLUsingHead("https://httpbin.org/status/404");
|
||||
assertEquals(404, responseCode);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenValidUrl_WhenUsingGET_ThenReturn200() throws IOException {
|
||||
UrlChecker tester = new UrlChecker();
|
||||
int responseCode = tester.getResponseCodeForURL("http://www.example.com");
|
||||
int responseCode = tester.getResponseCodeForURL("https://httpbin.org/status/200");
|
||||
assertEquals(200, responseCode);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenInvalidIUrl_WhenUsingGET_ThenReturn404() throws IOException {
|
||||
UrlChecker tester = new UrlChecker();
|
||||
int responseCode = tester.getResponseCodeForURL("http://www.example.com/xyz");
|
||||
int responseCode = tester.getResponseCodeForURL("https://httpbin.org/status/404");
|
||||
assertEquals(404, responseCode);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user