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

TMBuilder v3.2.0 - support explicit null checks for nodes #39

Merged
merged 10 commits into from
Aug 17, 2023

Conversation

yarg0007
Copy link
Collaborator

Request was made to define checks that verify nodes are null. v3.2.0 adds this support. Includes changes to JPChecks*, TMJPCheck* wrappers and all related unit tests.

@@ -190,7 +203,9 @@ public void processJsonPath(String jsonPath, SoftAssert softAssert, DocumentCont
return;
}

softAssert.assertNotNull(values, AssertMessageBuilder.build(jsonPath, "because the path does not exist."));
if (!isNullExpected()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For collection types, is it worth adding another check empty as well for size ?

Copy link
Collaborator Author

@yarg0007 yarg0007 Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty and size can both be evaluated by using the expected size check that already exists: https://github.com/eBay/NSTSuite/blob/main/NST/src/main/java/com/ebay/jsonpath/JPListOfIntegerCheck.java#L19 For the empty case size should be set to 0.

Copy link
Contributor

@shreyasmp shreyasmp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine so far.

Copy link
Collaborator

@juliandesmarais juliandesmarais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 suggestion to rename a var

NST/src/main/java/com/ebay/jsonpath/JPBooleanCheck.java Outdated Show resolved Hide resolved
@yarg0007 yarg0007 merged commit 0f2d6ef into main Aug 17, 2023
1 check passed
@yarg0007 yarg0007 deleted the byarger/tmbuilder branch August 17, 2023 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants