【发布时间】:2020-10-30 13:10:14
【问题描述】:
我是 API 测试新手。我想验证 GET 方法的响应正文。但它使用以下代码返回 io.restassured.internal.RestAssuredResponseImpl@35adf623。请让我知道我该如何解决这个问题。使用 POST 方法,它工作正常。使用提供的 GET 方法失败时,所有其他值都正确传递。
public static Response getResponseWithGetMethod() throws Exception {
Response response = RequestInvoker.invokeGET();
return response;
}
输出:
io.restassured.internal.RestAssuredResponseImpl@35adf623
预期输出是:
{
"path1": true,
"path2": true,
"path3": true
}
【问题讨论】:
-
你得到的是一个对象。要么 jsonify
response要么向您的对象添加toString()方法(前提是您编写了看起来不太可能的类)
标签: java api get rest-assured