Disable equals in JsonPath~ and XPathAssertions
Issue: SPR-17091
This commit is contained in:
parent
f5ff1dc3f9
commit
fcbf06f050
|
@ -176,4 +176,11 @@ public class JsonPathAssertions {
|
|||
return this.bodySpec;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
throw new AssertionError("Object#equals is disabled " +
|
||||
"to avoid being used in error instead of JsonPathAssertions#isEqualTo(String).");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -163,7 +163,6 @@ public class XpathAssertions {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
private WebTestClient.BodyContentSpec assertWith(CheckedExceptionTask task) {
|
||||
try {
|
||||
task.run();
|
||||
|
@ -190,6 +189,13 @@ public class XpathAssertions {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
throw new AssertionError("Object#equals is disabled " +
|
||||
"to avoid being used in error instead of XPathAssertions#isEqualTo(String).");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lets us be able to use lambda expressions that could throw checked exceptions, since
|
||||
* {@link XpathExpectationsHelper} throws {@link Exception} on its methods.
|
||||
|
|
Loading…
Reference in New Issue