Browse Source

add a test for one of the cases in issue 29

pull/20/head
Jochen Berger 11 years ago
parent
commit
2be8d8f67e
  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