@Test(expected = RuntimeException.class) public void pathAnyMatcherFinalResultNotAnArray() throws Exception{ JsonNode expectedResult = mapper.readTree("\"terminated\""); new AcceptorPathMatcher().pathAny(expectedResult, BooleanNode.TRUE); }
public static boolean pathAny(JsonNode expectedResult, JsonNode finalResult) { if (finalResult.isNull()) { return false; } if (!finalResult.isArray()) { throw new RuntimeException("Expected an array"); } for (JsonNode element : finalResult) { if (element.equals(expectedResult)) { return true; } } return false; }
AcceptorPathMatcher { public static boolean pathAny(JsonNode expectedResult, JsonNode finalResult) { if (finalResult.isNull()) { return false; } if (!finalResult.isArray()) { throw new RuntimeException("Expected an array"); } for (JsonNode element : finalResult) { if (element.equals(expectedResult)) { return true; } } return false; } }
AcceptorPathMatcher { public static boolean pathAny(JsonNode expectedResult, JsonNode finalResult) { if (finalResult.isNull()) { return false; } if (!finalResult.isArray()) { throw new RuntimeException("Expected an array"); } for (JsonNode element : finalResult) { if (element.equals(expectedResult)) { return true; } } return false; }  }
AcceptorPathMatcher { public static boolean pathAny(JsonNode expectedResult, JsonNode finalResult) { if (finalResult.isNull()) { return false; } if (!finalResult.isArray()) { throw new RuntimeException("Expected an array"); } for (JsonNode element : finalResult) { if (element.equals(expectedResult)) { return true; } } return false; }  static boolean pathAll(JsonNode expectedResult, JsonNode finalResult); static boolean pathAny(JsonNode expectedResult, JsonNode finalResult); static boolean path(JsonNode expectedResult, JsonNode finalResult); }
AcceptorPathMatcher { public static boolean pathAny(JsonNode expectedResult, JsonNode finalResult) { if (finalResult.isNull()) { return false; } if (!finalResult.isArray()) { throw new RuntimeException("Expected an array"); } for (JsonNode element : finalResult) { if (element.equals(expectedResult)) { return true; } } return false; }  static boolean pathAll(JsonNode expectedResult, JsonNode finalResult); static boolean pathAny(JsonNode expectedResult, JsonNode finalResult); static boolean path(JsonNode expectedResult, JsonNode finalResult);  }