File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
main/java/org/springframework/test/web/reactive/server
test/java/org/springframework/test/util Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public class JsonPathAssertions {
56
56
/**
57
57
* Applies {@link JsonPathExpectationsHelper#assertValue(String, Object)}.
58
58
*/
59
- public WebTestClient .BodyContentSpec isEqualTo (Object expectedValue ) {
59
+ public WebTestClient .BodyContentSpec isEqualTo (@ Nullable Object expectedValue ) {
60
60
this .pathHelper .assertValue (this .content , expectedValue );
61
61
return this .bodySpec ;
62
62
}
Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ class JsonPathExpectationsHelperTests {
57
57
'whitespace': ' ',
58
58
'emptyString': '',
59
59
'emptyArray': [],
60
- 'emptyMap': {}
60
+ 'emptyMap': {},
61
+ 'nullValue': null
61
62
}""" ;
62
63
63
64
private static final String SIMPSONS = """
@@ -249,6 +250,11 @@ void assertValue() {
249
250
new JsonPathExpectationsHelper ("$.num" ).assertValue (CONTENT , 5 );
250
251
}
251
252
253
+ @ Test
254
+ void assertNullValue () {
255
+ new JsonPathExpectationsHelper ("$.nullValue" ).assertValue (CONTENT , (Object ) null );
256
+ }
257
+
252
258
@ Test // SPR-14498
253
259
void assertValueWithNumberConversion () {
254
260
new JsonPathExpectationsHelper ("$.num" ).assertValue (CONTENT , 5.0 );
You can’t perform that action at this time.
0 commit comments