Repository navigation
ISSUE-507 # Fallback to NullNode when assertions and verify are null in Step - #816
Conversation
|
Looks good. 👍 |
|
Hello @imsurya26 , have you tested this change locally before pushing your commits? Next, can you run locally and fix these, then push the fix? You can see the failures here in this page as well:
|
Step now falls back to NullNode when both assertions and verify are missing, so the echo-step early return in compareStepResults must check isNull() as well as null. Without it, an echo step with no assertions was compared leniently against "null" and failed.
|
Thanks for checking, and sorry about that. I had only run The failing test was c4bd49a fixes it by treating a && (thisStep.getAssertions() == null || thisStep.getAssertions().isNull())I ran |
|
sounds good. Given a rerun now |
|
CI passed and PR merged |

Fallback to NullNode when assertions and verify are null in Step
Fixed Which Issue?
PR Branch
https://github.com/imsurya26/zerocode/tree/fix/507-step-assertions-null-safe
Motivation and Context
In Jackson 2.13+ / Spring Boot 2.6+, deserializing test scenario steps where both \�ssertions\ and \�erify\ blocks are omitted caused \step.getAssertions()\ to return Java
ull. Downstream processors expecting a non-null \JsonNode\ (e.g., calling .toString()\ or querying nodes) crashed with \NullPointerException.
In \Step.java, the constructor previously used:
\\java
this.assertions = assertions == null || assertions.isNull() ? verify : assertions;
\`nIf \�erify\ was also null, \ his.assertions\ became null.
Solution
Fallback to \NullNode.getInstance()\ if both \�ssertions\ and \�erify\ are null or represent JSON null:
\\java
this.assertions = assertions != null && !assertions.isNull() ? assertions : (verify != null ? verify : NullNode.getInstance());
\`nThis guarantees \getAssertions()\ is never Java
ull, while preserving \isNull() == true\ for JSON null checks.
Checklist:
Closes #507