You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2023/01/03 14:20:45 UTC

[GitHub] [avro] martin-g commented on a diff in pull request #2015: AVRO-3690: [lang/java/avro] Fix flaky test ‘testMultipleFieldAliases’

martin-g commented on code in PR #2015:
URL: https://github.com/apache/avro/pull/2015#discussion_r1060629717


##########
lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflect.java:
##########
@@ -1274,12 +1274,14 @@ public void namespaceDefinitionOnFieldAliasMustThrowException() {
 
   @Test
   public void testMultipleFieldAliases() {
-
-    Schema expectedSchema = SchemaBuilder.record(ClassWithMultipleAliasesOnField.class.getSimpleName())
-        .namespace("org.apache.avro.reflect.TestReflect").fields().name("primitiveField").aliases("alias1", "alias2")
-        .type(Schema.create(org.apache.avro.Schema.Type.INT)).noDefault().endRecord();
-
-    check(ClassWithMultipleAliasesOnField.class, expectedSchema.toString());
+    Field field = new Field("primitiveField", Schema.create(Schema.Type.INT));
+    field.addAlias("alias1");
+    field.addAlias("alias2");
+    Schema avroMultiMeta = Schema.createRecord("ClassWithAliasOnField", null, "org.apache.avro.reflect.TestReflect",

Review Comment:
   ```suggestion
       Schema avroMultiMeta = Schema.createRecord("ClassWithMultipleAliasesOnField", null, "org.apache.avro.reflect.TestReflect",
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org