@Test public void pathAllMatcher_SuccessState() throws Exception{ JsonNode expectedResult = mapper.readTree("\"running\""); Assert.assertTrue("Expected result not equals final result", new AcceptorPathMatcher().pathAll(expectedResult, mapper.readTree("[\"running\", \"running\", \"running\", \"running\"]"))); }
public static boolean pathAll(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 false; } } return true; }
AcceptorPathMatcher { public static boolean pathAll(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 false; } } return true; } }
AcceptorPathMatcher { public static boolean pathAll(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 false; } } return true; }  }
AcceptorPathMatcher { public static boolean pathAll(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 false; } } return true; }  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 pathAll(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 false; } } return true; }  static boolean pathAll(JsonNode expectedResult, JsonNode finalResult); static boolean pathAny(JsonNode expectedResult, JsonNode finalResult); static boolean path(JsonNode expectedResult, JsonNode finalResult);  }