Browse Source

Added test for issue #143

pull/158/head
Kalle Stenflo 9 years ago
parent
commit
be21f2235e
  1. 12
      json-path/src/test/java/com/jayway/jsonpath/old/IssuesTest.java

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

@ -43,6 +43,18 @@ public class IssuesTest extends BaseTest {
private static final JsonProvider jp = Configuration.defaultConfiguration().jsonProvider(); private static final JsonProvider jp = Configuration.defaultConfiguration().jsonProvider();
@Test
public void issue_143() {
String json = "{ \"foo\": { \"bar\" : \"val\" }, \"moo\": { \"cow\" : \"val\" } }";
Configuration configuration = Configuration.builder().options( Option.AS_PATH_LIST ).build();
List<String> pathList = JsonPath.using(configuration).parse(json).read(JsonPath.compile("$.*.bar"));
assertThat(pathList).containsExactly("$['foo']['bar']");
}
@Test @Test
public void issue_114_a() { public void issue_114_a() {
String json = "{ \"p\":{\n" + String json = "{ \"p\":{\n" +

Loading…
Cancel
Save