Skip to content

Commit 7baf6d1

Browse files
committed
Merge branch '6.2.x'
2 parents 1107a43 + 9e8c640 commit 7baf6d1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

spring-test/src/main/java/org/springframework/test/web/support/AbstractJsonPathAssertions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected AbstractJsonPathAssertions(B spec, String content, String expression,
5858
/**
5959
* Applies {@link JsonPathExpectationsHelper#assertValue(String, Object)}.
6060
*/
61-
public B isEqualTo(Object expectedValue) {
61+
public B isEqualTo(@Nullable Object expectedValue) {
6262
this.pathHelper.assertValue(this.content, expectedValue);
6363
return this.bodySpec;
6464
}

spring-test/src/test/java/org/springframework/test/util/JsonPathExpectationsHelperTests.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ class JsonPathExpectationsHelperTests {
6060
'whitespace': ' ',
6161
'emptyString': '',
6262
'emptyArray': [],
63-
'emptyMap': {}
63+
'emptyMap': {},
64+
'nullValue': null
6465
}""";
6566

6667
private static final String SIMPSONS = """
@@ -252,6 +253,11 @@ void assertValue() {
252253
new JsonPathExpectationsHelper("$.num").assertValue(CONTENT, 5);
253254
}
254255

256+
@Test
257+
void assertNullValue() {
258+
new JsonPathExpectationsHelper("$.nullValue").assertValue(CONTENT, (Object) null);
259+
}
260+
255261
@Test // SPR-14498
256262
void assertValueWithNumberConversion() {
257263
new JsonPathExpectationsHelper("$.num").assertValue(CONTENT, 5.0);

0 commit comments

Comments
 (0)