Skip to content

Commit

Permalink
Merge pull request lukas-krecan#87 from gsson/patch-1
Browse files Browse the repository at this point in the history
JsonFluentAssert.isStringEqualTo() should return JsonFluentAssertAfterAssertion
  • Loading branch information
lukas-krecan authored Dec 4, 2017
2 parents cdde3d4 + 22f169b commit 5a7e1c3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ public JsonFluentAssertAfterAssertion isEqualTo(Object expected) {
* Fails if the selected JSON is not a String or is not present or the value
* is not equal to expected value.
*/
public void isStringEqualTo(String expected) {
public JsonFluentAssertAfterAssertion isStringEqualTo(String expected) {
isString();
Node node = getNode(actual, path);
if (!node.asText().equals(expected)) {
failWithMessage(String.format("Different value found in node \"%s\", expected: <\"%s\"> but was: <\"%s\">.", path, expected, node.asText()));
}
return JsonFluentAssertAfterAssertion.wrap(this);
}

/**
Expand Down

0 comments on commit 5a7e1c3

Please sign in to comment.