Browse Source

Merge pull request #20 from jochenberger/add_test_for_issue_29_part_1

add a test for one of the cases in issue 29
pull/21/merge
kallestenflo 11 years ago
parent
commit
d50287a607
  1. 9
      json-path/src/test/java/com/jayway/jsonpath/IssuesTest.java

9
json-path/src/test/java/com/jayway/jsonpath/IssuesTest.java

@ -40,6 +40,13 @@ public class IssuesTest {
assertTrue(result.isEmpty());
}
@Test
public void issue_29_b() throws Exception {
String json = "{\"list\": [ { \"a\":\"atext\", \"b\":{ \"b-a\":\"batext\", \"b-b\":\"bbtext\" } }, { \"a\":\"atext2\", \"b\":{ \"b-a\":\"batext2\", \"b-b\":\"bbtext2\" } } ] }";
List<String> result = JsonPath.read(json, "$.list[?]", Filter.filter(Criteria.where("b.b-a").eq("batext2")));
assertTrue(result.size() == 1);
}
}

Loading…
Cancel
Save