From c1b7badb56d2226c555d24ee2714512ca03bbf30 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Sun, 27 Mar 2016 23:38:33 +0200 Subject: [PATCH] Added a test for JSON Paths without assertion --- .../groovy/com/toomuchcoding/jsonassert/JsonAssertionSpec.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/jsonassert/src/test/groovy/com/toomuchcoding/jsonassert/JsonAssertionSpec.groovy b/jsonassert/src/test/groovy/com/toomuchcoding/jsonassert/JsonAssertionSpec.groovy index 2035bf6..d8e564c 100644 --- a/jsonassert/src/test/groovy/com/toomuchcoding/jsonassert/JsonAssertionSpec.groovy +++ b/jsonassert/src/test/groovy/com/toomuchcoding/jsonassert/JsonAssertionSpec.groovy @@ -35,6 +35,7 @@ public class JsonAssertionSpec extends Specification { where: verifiable || expectedJsonPath assertThat(json1).field("some").field("nested").field("anothervalue").isEqualTo(4) || '''$.some.nested[?(@.anothervalue == 4)]''' + assertThat(json1).field("some").field("nested").field("anothervalue") || '''$.some.nested.anothervalue''' assertThatJson(json1).field("some").field("nested").field("anothervalue").isEqualTo(4) || '''$.some.nested[?(@.anothervalue == 4)]''' assertThat(json1).field("some").field("nested").array("withlist").contains("name").isEqualTo("name1") || '''$.some.nested.withlist[*][?(@.name == 'name1')]''' assertThat(json1).field("some").field("nested").array("withlist").contains("name").isEqualTo("name2") || '''$.some.nested.withlist[*][?(@.name == 'name2')]'''