1、maven中添加依赖
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>rest-assured</artifactId>
<version>2.9.0</version>
</dependency>
2、代码中调用
@BeforeClass
public void before() {
RestAssured.baseURI = "http://localhost";
RestAssured.port = 8080;
}
@AfterClass
public void after() {
}
@Test
public void test_cookie_zhi(){
String cookie_zhi = get("/your-interface").getBody().print();
logger.info(cookie_zhi);
}