File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/test/java/de/claudioaltamura/java/restassured Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,21 @@ void shouldFindAllStarshipWithSpecificRating() {
1919 assertThat (starshipWithSpecificRating ).isNotEmpty ().hasSize (4 );
2020 }
2121
22+ @ Test
23+ void shouldResponseAllFilmsAnd200 () {
24+ var films =
25+ get ("http://swapi.dev/api/films/?format=json" ).then ().statusCode (200 ).extract ().jsonPath ();
26+ assertThat (films .getList ("results" )).hasSize (6 );
27+ assertThat (films .getList ("results.title" ))
28+ .contains (
29+ "A New Hope" ,
30+ "The Empire Strikes Back" ,
31+ "Return of the Jedi" ,
32+ "The Phantom Menace" ,
33+ "Attack of the Clones" ,
34+ "Revenge of the Sith" );
35+ }
36+
2237 /**
2338 * @Test void sumUpNamesLengthWithJsonPath() { String response =
2439 * get("http://restcountries.eu/rest/v1/").asString();
@@ -27,4 +42,5 @@ void shouldFindAllStarshipWithSpecificRating() {
2742 *
2843 * <p>assertThat(sumNames).isEqualTo(2490); }
2944 */
45+
3046}
You can’t perform that action at this time.
0 commit comments