Java 20277 (#14046)
* JAVA-20277 GitHub Issue: Regarding article Introduction to JsonPath * JAVA-20277 Code Review Changes
This commit is contained in:
parent
30eb8c30ad
commit
539bf3438d
|
@ -103,11 +103,11 @@ public class ServiceIntegrationTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenJsonPathWithFilterPredicate_whenReadingRootNode_thenCorrect() {
|
public void givenJsonPathWithFilterPredicate_whenReadingRootNode_thenCorrect() {
|
||||||
Filter expensiveFilter = Filter.filter(Criteria.where("director")
|
Filter directorSamMendesFilter = Filter.filter(Criteria.where("director")
|
||||||
.contains("Sam Mendes"));
|
.contains("Sam Mendes"));
|
||||||
List<Map<String, Object>> predicate = JsonPath.parse(jsonString)
|
List<Map<String, Object>> samMendesMovies = JsonPath.parse(jsonString)
|
||||||
.read("$[?]['director']", expensiveFilter);
|
.read("$[?]['director']", directorSamMendesFilter);
|
||||||
assertEquals(predicate.size(), 2);
|
assertEquals(samMendesMovies.size(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue