/** * Fails if the node is missing. */ public JsonFluentAssert isPresent() { return isPresent("node to be present"); }
/** * Fails if the node is missing. */ public JsonFluentAssert isPresent() { return isPresent("node to be present"); }
/** * Matches the node using Hamcrest matcher. * * <ul> * <li>Numbers are mapped to BigDecimal</li> * <li>Arrays are mapped to a Collection</li> * <li>Objects are mapped to a map so you can use json(Part)Equals or a Map matcher</li> * </ul> * * @param matcher * @return */ public JsonFluentAssert matches(Matcher<?> matcher) { isPresent(); match(actual, path, matcher); return this; }
/** * Matches the node using Hamcrest matcher. * * <ul> * <li>Numbers are mapped to BigDecimal</li> * <li>Arrays are mapped to a Collection</li> * <li>Objects are mapped to a map so you can use json(Part)Equals or a Map matcher</li> * </ul> * * @param matcher * @return */ public JsonFluentAssert matches(Matcher<?> matcher) { isPresent(); match(actual, path, matcher); return this; }
private Node assertType(NodeType type) { isPresent(type.getDescription()); Node node = getNode(actual, path); if (node.getNodeType() != type) { failOnType(node, type); } return node; }
private Node assertType(NodeType type) { isPresent(type.getDescription()); Node node = getNode(actual, path); if (node.getNodeType() != type) { failOnType(node, type); } return node; }