Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public AssertJson<T> satisfies(Condition condition) {
Result result = condition.test(converted);
if (!result.isPassed()) {
throw new AssertionFailedError("Expected: " + condition.describe() +
"\n but: " + result.getCondition() + " was " + result.getWas(),
"\n but:\n" + converted.toPrettyString() + "\nwas " + result.getWas(),
result.getCondition(), result.getWas());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void jsonAtWithAssertJson() {
void jsonAtWithAssertJsonNegative() {
assertThatThrownBy(() -> assertJson("{\"name\":\"Bill\"}").at("/name").hasValue("Not Bill"))
.isInstanceOf(Error.class)
.hasMessage("Expected: Path at /name is equal to Not Bill\n but: /name is equal to Not Bill was \"Bill\"");
.hasMessage("Expected: Path at /name is equal to Not Bill\n but:\n{\n \"name\" : \"Bill\"\n}\nwas \"Bill\"");
}

@Test
Expand All @@ -81,7 +81,7 @@ void jsonAtMultiWithAssertJsonNegative() {
.at("/name").hasValue("Bill")
.at("/age").hasValue(12))
.isInstanceOf(Error.class)
.hasMessage("Expected: Path at /age is equal to 12\n but: /age is equal to 12 was 42");
.hasMessage("Expected: Path at /age is equal to 12\n but:\n{\n \"name\" : \"Bill\",\n \"age\" : 42\n}\nwas 42");
}

@Test
Expand Down