Merge branch '6.2.x'
This commit is contained in:
commit
7baf6d12b0
|
@ -58,7 +58,7 @@ public abstract class AbstractJsonPathAssertions<B> {
|
|||
/**
|
||||
* Applies {@link JsonPathExpectationsHelper#assertValue(String, Object)}.
|
||||
*/
|
||||
public B isEqualTo(Object expectedValue) {
|
||||
public B isEqualTo(@Nullable Object expectedValue) {
|
||||
this.pathHelper.assertValue(this.content, expectedValue);
|
||||
return this.bodySpec;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,8 @@ class JsonPathExpectationsHelperTests {
|
|||
'whitespace': ' ',
|
||||
'emptyString': '',
|
||||
'emptyArray': [],
|
||||
'emptyMap': {}
|
||||
'emptyMap': {},
|
||||
'nullValue': null
|
||||
}""";
|
||||
|
||||
private static final String SIMPSONS = """
|
||||
|
@ -252,6 +253,11 @@ class JsonPathExpectationsHelperTests {
|
|||
new JsonPathExpectationsHelper("$.num").assertValue(CONTENT, 5);
|
||||
}
|
||||
|
||||
@Test
|
||||
void assertNullValue() {
|
||||
new JsonPathExpectationsHelper("$.nullValue").assertValue(CONTENT, (Object) null);
|
||||
}
|
||||
|
||||
@Test // SPR-14498
|
||||
void assertValueWithNumberConversion() {
|
||||
new JsonPathExpectationsHelper("$.num").assertValue(CONTENT, 5.0);
|
||||
|
|
Loading…
Reference in New Issue