I'm doing an assignment for school :
Requirement :
- Create a search ("s) for the items containing "Fantabulous"
- Verify that the movie with id "tt7713068" is in the list
- Use a json path to generate a list of movie ID's and loop over it to search for the movie with the correct ID.
This is what I have:
//@Test
public void search_for_movies_on_string_and_validate_one_of_the_results() {
Response response = given().
param("apikey", apiKey).
param("s", "Fantabulous").
when().get(baseURI).
then().extract().response();
JsonPath jsonPath = response.jsonPath();
List<String> idList = jsonPath.getList("Search.imdbID");
Assert.assertTrue(idList.contains("tt7713068"));
}
How can I loop over a list to search for the movie with the correct ID?
apiKey = "7548cb76"
baseURI = "http://www.omdbapi.com/"