import org.json.*; //导入json包
String response = prev.getResponseDataAsString(); //获取响应的值
JSONObject responseJson = new JSONObject(response); //转换成json格式
String message = responseJson.getString("message"); //获取请求的message字段
log.info("响应message字段:" + message); //
if (message.equals("处理成功")){
Failure = false;
}
else{
Failure = true;
FailureMessage = "响应字段不是处理成功";
}
String code = responseJson.getString("code");
log.info("响应code字段:" + code);
if (code.equals("0000")){
Failure = false; //断言成功
}
else{
Failure = true; //断言失败
FailureMessage = "响应状态码不是000"; //自定义反回信息
}