[JAVA-32852] Fix UrlCheckerIntegrationTest (#16292)

This commit is contained in:
Harry9656 2024-04-04 07:05:25 +02:00 committed by GitHub
parent f82778cc17
commit aa8016e838
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -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);
}