package com.exmple.e2e;

import io.restassured.RestAssured;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import static com.exmple.e2e.TestUtil.propertyValue;
import static io.restassured.RestAssured.given;

public class PetsApiTest {

    @BeforeAll
    public static void setup() {
        RestAssured.baseURI  = propertyValue("server.host", "http://localhost");
        RestAssured.port     = propertyValue("server.port", 9001);
        RestAssured.basePath = propertyValue("server.base", "/");
    }

    @Test
    public void test__pet_website__is_running_ok() {
        given()
                .when().get("/")
                .then().statusCode(200);
    }

    @Test
    public void test__getPets_api__can__return_default_pets() {
        given()
                .when().get("/pets")
                .then().statusCode(200);
    }

}

@@ -29,34 +29,115 @@
 ort 
-io.restassured.RestAssured
+com.fasterxml.jackson.databind.ObjectMapper;%0Aimport io.restassured.RestAssured;%0Aimport io.swagger.model.Pet
 ;%0Aim
@@ -174,16 +174,50 @@
 oreAll;%0A
+import org.junit.jupiter.api.Tag;%0A
 import o
@@ -244,16 +244,45 @@
 .Test;%0A%0A
+import java.io.IOException;%0A%0A
 import s
@@ -326,16 +326,62 @@
 yValue;%0A
+import static io.restassured.RestAssured.get;%0A
 import s
@@ -419,16 +419,154 @@
 d.given;
+%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.equalTo;%0Aimport static org.hamcrest.Matchers.is;
 %0A%0Apublic
@@ -858,32 +858,55 @@
    %7D%0A%0A    @Test%0A
+    @Tag(%22happy_path%22)%0A
     public void 
@@ -1108,18 +1108,67 @@
 ult_pets
-()
+___by_direct_access_json_field() throws IOException
  %7B%0A     
@@ -1246,27 +1246,457 @@
 .statusCode(200)
+%0A                       .body(%22%5B0%5D.name%22, equalTo(%22foo%22));%0A    %7D%0A%0A    @Test%0A    public void test__getPets_api__can__return_default_pets___by_json_deserialization() throws IOException %7B%0A        String json = get(%22/pets%22).asString();%0A%0A        ObjectMapper mapper = new ObjectMapper();%0A        Pet%5B%5D pets = mapper.readValue(json, Pet%5B%5D.class);%0A%0A        assertThat(pets.length, is(1));%0A        assertThat(pets%5B0%5D.getName(), is(%22foo%22))
 ;%0A    %7D%0A%0A%7D%0A

add testcases to show usage of REST-assured