Skip to content

Commit

Permalink
reverted http agent TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
junaidwarsivd committed Aug 23, 2021
1 parent 320f104 commit e9bf087
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void setUp() {
httpAgent.setReadTimeout(60000);
}

@Test
@Test(expected = IllegalArgumentException.class)
public void testFetchFailsGivenWrongUrl() {
Response<String> resp = httpAgent.fetch("wrong.url");
Assert.assertEquals(ResponseStatus.failure, resp.status());
Expand All @@ -204,7 +204,7 @@ public void testFetchPassesGivenCorrectUrl() {
Assert.assertEquals(ResponseStatus.success, resp.status());
}

@Test
@Test(expected = IllegalArgumentException.class)
public void testPostFailsGivenWrongUrl() {
HashMap<String, String> map = new HashMap<>();
map.put("title", "OpenSRP Testing Tuesdays");
Expand All @@ -230,7 +230,7 @@ public void testUrlCanBeAccessWithGivenCredentials() {
Assert.assertEquals(LoginResponse.SUCCESS.message(), resp.message());
}

@Test
@Test(expected = IllegalArgumentException.class)
public void testUrlCanBeAccessWithGivenCredentialsGivenWrongUrl() {
PowerMockito.mockStatic(Base64.class);
LoginResponse resp = httpAgent.urlCanBeAccessWithGivenCredentials("wrong.url", "", "".toCharArray());
Expand All @@ -244,7 +244,7 @@ public void testUrlCanBeAccessWithGivenCredentialsGivenEmptyResp() {
Assert.assertEquals(LoginResponse.SUCCESS_WITH_EMPTY_RESPONSE.message(), resp.message());
}

@Test
@Test(expected = IllegalArgumentException.class)
public void testfetchWithCredentialsFailsGivenWrongUrl() {
Response<String> resp = httpAgent.fetchWithCredentials("wrong.url", SAMPLE_TEST_TOKEN);
Assert.assertEquals(ResponseStatus.failure, resp.status());
Expand All @@ -257,7 +257,7 @@ public void testfetchWithCredentialsPassesGivenCorrectUrl() {
Assert.assertEquals(ResponseStatus.success, resp.status());
}

@Test
@Test(expected = IllegalArgumentException.class)
public void testHttpImagePostGivenWrongUrl() {
String resp = httpAgent.httpImagePost("wrong.url", profileImage);
Assert.assertEquals("", resp);
Expand Down

0 comments on commit e9bf087

Please sign in to comment.