Skip to content

Commit

Permalink
Updated APICharityScraperTest
Browse files Browse the repository at this point in the history
Added a test to check that JSON entries with status:'obs' gets ignored.
  • Loading branch information
roaraf committed Mar 4, 2026
1 parent 636351e commit e99d6c7
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,18 @@ void parsedJSONOfNullShouldReturnEmptyList() throws URISyntaxException {
"null objects.");
}

@Test
void shouldRemoveObsStatusEntries() throws URISyntaxException {
APICharityScraper con = new APICharityScraper(HttpClient.newHttpClient());

String JSONData = "[{\"org_number\":\"938419264\",\"name\":\"Misjonsalliansen\",\"status\":\"obs\"," +
"\"url\":\"https://www.innsamlingskontrollen.no/organisasjoner/misjonsalliansen/\",\"" +
"is_pre_approved\":false}]";
List<APICharityData> list = con.parseJSON(JSONData);

assertEquals(0, list.size(),"Entries containing 'obs' should be ignored, so list should " +
"be empty.");

}

}

0 comments on commit e99d6c7

Please sign in to comment.