-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix complex default conversion - handle list #522
Conversation
e06874d
to
093b664
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #522 +/- ##
============================================
+ Coverage 45.78% 45.81% +0.02%
- Complexity 4444 4445 +1
============================================
Files 403 403
Lines 28070 28091 +21
Branches 4622 4628 +6
============================================
+ Hits 12853 12871 +18
+ Misses 13664 13663 -1
- Partials 1553 1557 +4
☔ View full report in Codecov by Sentry. |
FieldBuilder builder = AvroCompatibilityHelper.newField(field); | ||
builder.setDefault(defaultValue); | ||
Schema.Field resField = builder.build(); | ||
Assert.assertNotNull(resField.defaultVal()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an assertEquals test as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assert isn't the essential part of the test. The essential part is that .build()
doesn't fail. Added a comment in the code
FieldBuilder19
,FieldBuilder110
,FieldBuilder111
handle conversion of default values into "acceptable" default values. However, this conversion wasn't handling default values that were non-empty lists.Added UTs to test this case.
More details on this method in the java doc: