Fixes missing casting; fixes gh-764
This commit is contained in:
@@ -492,7 +492,7 @@ abstract class MethodBodyBuilder {
|
||||
|
||||
protected void methodForNullCheck(BodyMatcher bodyMatcher, BlockBuilder bb) {
|
||||
String quotedAndEscaptedPath = quotedAndEscaped(bodyMatcher.path())
|
||||
String method = "assertThat(parsedJson.read(${quotedAndEscaptedPath})).isNull()"
|
||||
String method = "assertThat((Object) parsedJson.read(${quotedAndEscaptedPath})).isNull()"
|
||||
bb.addLine(postProcessJsonPathCall(method))
|
||||
addColonIfRequired(bb)
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ class MockMvcMethodBodyBuilderWithMatchersSpec extends Specification implements
|
||||
test.contains('assertThat((java.lang.Iterable) parsedJson.read("' + rootElement + '.valueWithMaxEmpty", java.util.Collection.class)).as("' + rootElement + '.valueWithMaxEmpty").hasSizeLessThanOrEqualTo(0)')
|
||||
test.contains('assertThatValueIsANumber(parsedJson.read("' + rootElement + '.duck")')
|
||||
test.contains('assertThat(parsedJson.read("' + rootElement + '''.['key'].['complex.key']", String.class)).isEqualTo("foo")''')
|
||||
test.contains('assertThat(parsedJson.read("' + rootElement + '.nullValue")).isNull()')
|
||||
test.contains('assertThat((Object) parsedJson.read("' + rootElement + '.nullValue")).isNull()')
|
||||
!test.contains('cursor')
|
||||
and:
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user