Skip to content

Commit

Permalink
[bug] at is ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
lmartelli committed Nov 16, 2024
1 parent 6aef53b commit c8ffb4b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/java/uk/org/webcompere/modelassert/json/ExamplesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -541,4 +541,14 @@ void atPath_whenKeysAreMissingInTheActualThenObjectContainsFixesIt() {
.path("z").objectContains()
.isEqualTo("{z:{b:{d:false, c:true}}}");
}

@Test
void at_isCheckedEvenIfTreeComparisonSucceeds() {
assertThatThrownBy(() ->
assertJson("{foo: 42}")
.where().objectContains()
.at("/foo").isText()
.isEqualTo("{}"))
.isInstanceOf(AssertionFailedError.class);
}
}

0 comments on commit c8ffb4b

Please sign in to comment.