[1.3.28] Step "assertions" field is not null safe
Is it possible to make Step.assertions field null safe ? We're using tests on spring boot and with version changed from 2.5.4 to 2.6.1 we're receiving NPE on Step constructor. JsonNode assertions was previously always not null - now it's null.
this.assertions = assertions.isNull() ? verify : assertions;
@infoShare can you share the step that's producing NPE?
Try to use framework with jackson-databind 2.13.0
You'll receive this error for steps that doesn't contains assertions:
Caused by: java.lang.NullPointerException
at org.jsmart.zerocode.core.domain.Step.
Assertions here is null: this.assertions = assertions.isNull() ? verify : assertions; and with previous jackson versions was always not null (NullNode with 'null' value).
@infoShare you can specify empty assertions block.
assertions : {}
It should help with NPE
but what is the point of adding additional assertions: {} next to the verify which can be used ?
@infoShare I understand now. I agree this should be null safe. For a workaround, make sure that during test phase, it uses old jackson-databind(that comes from zerocode), not new one.
@infoShare this is a known issue in jackson-core for more inforamtion please refer to this lik. https://github.com/FasterXML/jackson-databind/issues/3214