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

add support for recursively set default value in test mode #464

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

ZihanLi58
Copy link
Contributor

@ZihanLi58 ZihanLi58 commented Oct 31, 2024

Summary

Add support for recursively set default value in test mode

Testing Done

Add unit test
Also this only change the behavior for test mode, will not affect the prod behavior at all
snapshot the version and deploy to local to make sure it works, but it won't change the data for things that already set to empty.

Checklist

/**
* For unit tests
*/
valueWithDefault: string = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

to add other/complex default data structure in test model? such as nested and map {}?

@@ -77,6 +79,27 @@ public static String toJsonString(@Nonnull RecordTemplate recordTemplate) {
}
}

/**
* Serializes a {@link RecordTemplate} to JSON string.
*Also take test mode as input to control the default value fill in strategy
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: indent

@RealChrisL RealChrisL merged commit 484211f into linkedin:master Nov 1, 2024
2 checks passed
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.

2 participants