Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.3.28] Step "assertions" field is not null safe #507

Open
infoShare opened this issue Dec 8, 2021 · 6 comments
Open

[1.3.28] Step "assertions" field is not null safe #507

infoShare opened this issue Dec 8, 2021 · 6 comments
Labels

Comments

@infoShare
Copy link

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;

@sparrowV
Copy link
Collaborator

@infoShare can you share the step that's producing NPE?

@infoShare
Copy link
Author

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.(Step.java:154)

Assertions here is null:
this.assertions = assertions.isNull() ? verify : assertions;
and with previous jackson versions was always not null (NullNode with 'null' value).

@sparrowV
Copy link
Collaborator

@infoShare you can specify empty assertions block.
assertions : {}
It should help with NPE

@infoShare
Copy link
Author

but what is the point of adding additional assertions: {} next to the verify which can be used ?

@sparrowV
Copy link
Collaborator

@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.

@sparrowV sparrowV added the bug label Dec 20, 2021
@chou3ib1
Copy link

@infoShare this is a known issue in jackson-core
for more inforamtion please refer to this lik.
FasterXML/jackson-databind#3214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants