<dependency> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <version>4.3.3</version> <scope>test</scope> </dependency> import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import org.testng.annotations.Test; @Test public void testGetUser() { given() .param("name", "John") .when() .get("/users") .then() .statusCode(200) .body("firstName", hasItems("John")) .body("age[0]", equalTo(30)); }


上一篇:
下一篇:
切换中文