Challenge 4 rest-assured

Solution

Sử dụng findAll 2 lần, lồng vào nhau

@Test
void name8() {
    String res = RestAssured.get("https://auto-test-challenges.herokuapp.com/challenge4restassured")
            .asString();
    JsonPath jsonPath = new JsonPath(res);
    List<String> list = jsonPath.getList("findAll {it.batter.findAll {it.type == 'Chocolate'}}.name");
    System.out.println(list); //[Choco Blueberry Cake]
}
0 0 votes
Đánh giá challenge
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments