tpalfy commented on code in PR #8361:
URL: https://github.com/apache/nifi/pull/8361#discussion_r1483208617


##########
nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/avro/TestAvroReaderWithExplicitSchema.java:
##########
@@ -105,6 +105,34 @@ public void 
testAvroExplicitReaderWithEmbeddedSchemaFileDifferentFromExplicitSch
         assertThrows(IOException.class, () -> new 
AvroReaderWithExplicitSchema(fileInputStream, recordSchema, dataSchema));
     }
 
+    @Test
+    public void testAvroExplicitReaderWithSchemalessFileAndExplicitSchema() 
throws Exception {
+        AvroReaderWithExplicitSchema avroReader = 
createAvroReaderWithExplicitSchema(
+                "src/test/resources/avro/schemaless_simple_record.avro",
+                "src/test/resources/avro/schemaless_simple_record.avsc"
+        );
+
+        GenericData.Record expected = new GenericData.Record(new 
Schema.Parser().parse(new 
File("src/test/resources/avro/schemaless_simple_record.avsc")));
+        expected.put("field_1", 123);
+        expected.put("field_2", "44");
+        expected.put("field_3", 5);
+
+        GenericRecord actual1 = avroReader.nextAvroRecord();
+        assertNotNull(actual1);

Review Comment:
   ```suggestion
           assertEquals(expected, actual1);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to