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 ; }
PathAll matcher that checks if each element of the final result matches the expected result