Merge branch '6.2.x'

This commit is contained in:
Sébastien Deleuze 2025-09-09 11:28:09 +02:00
commit 7baf6d12b0
2 changed files with 8 additions and 2 deletions

View File

@ -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;
}

View File

@ -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);