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

fix complex default conversion - handle list #522

Merged
merged 6 commits into from
Nov 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add comment
  • Loading branch information
dg-builder committed Nov 5, 2023
commit 0e048dec0f1feb6784db3ff18075d5931950bafc
Original file line number Diff line number Diff line change
@@ -167,6 +167,8 @@ public void testArrayOfEnumDefaultValue() throws IOException {
Object defaultValue = AvroCompatibilityHelper.getGenericDefaultValue(field);
FieldBuilder builder = AvroCompatibilityHelper.newField(field);
builder.setDefault(defaultValue);

// Test that .build() should not throw an exception.
Schema.Field resField = builder.build();
Assert.assertNotNull(resField.defaultVal());
Copy link
Member

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

Copy link
Collaborator Author

@dg-builder dg-builder Nov 5, 2023

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

}
Original file line number Diff line number Diff line change
@@ -23,7 +23,9 @@ public void testArrayOfEnumDefaultValue() throws IOException {
Object defaultValue = AvroCompatibilityHelper.getGenericDefaultValue(field);
FieldBuilder builder = AvroCompatibilityHelper.newField(field);
builder.setDefault(defaultValue);

// Test that .build() should not throw an exception.
Schema.Field resField = builder.build();
Assert.assertNotNull(resField.defaultVal());
Assert.assertNotNull(resField);
}
}
Original file line number Diff line number Diff line change
@@ -167,6 +167,8 @@ public void testArrayOfEnumDefaultValue() throws IOException {
Object defaultValue = AvroCompatibilityHelper.getGenericDefaultValue(field);
FieldBuilder builder = AvroCompatibilityHelper.newField(field);
builder.setDefault(defaultValue);

// Test that .build() should not throw an exception.
Schema.Field resField = builder.build();
Assert.assertNotNull(resField.defaultVal());
}