【发布时间】:2018-09-25 09:30:32
【问题描述】:
代码如下
Response response = null;
try {
response =given().log().everything().when().get().
then().contentType(ContentType.JSON).extract().response();
String a = response.jsonPath().getString("aType");
String b = response.jsonPath().getString("bType");
System.out.printn(a+b);
}
但是我在 print 中看到 null 输出而不是 value,有什么线索吗?
【问题讨论】:
-
您确定您的回复中有“aType”和“bType”之类的字段,能否请您提供一个示例回复。
标签: json rest-assured