@Override
protected boolean matchesSafely(JsonNode jsonForwardingObj, Description description) {
ObjectiveJsonMatcher.matchesObjective(forwardingObjective).matchesSafely(jsonForwardingObj);
// check id
int jsonId = jsonForwardingObj.get("id").asInt();
int id = forwardingObjective.id();
if (jsonId != id) {
description.appendText("id was " + jsonId);
return false;
}
// check nextId
int jsonNextId = jsonForwardingObj.get("nextId").asInt();
int nextId = forwardingObjective.nextId();
if (jsonNextId != nextId) {
description.appendText("nextId was " + jsonNextId);
return false;
}
// check flag
String jsonFlag = jsonForwardingObj.get("flag").asText();
String flag = forwardingObjective.flag().toString();
if (!jsonFlag.equals(flag)) {
description.appendText("flag was " + jsonFlag);
return false;
}
return true;
}
ForwardingObjectiveJsonMatcher.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:athena
作者:
评论列表
文章目录