martin-g commented on code in PR #3543:
URL: https://github.com/apache/avro/pull/3543#discussion_r2500957654
##########
lang/java/avro/src/test/java/org/apache/avro/TestSchema.java:
##########
@@ -238,6 +233,15 @@ void serialization() throws IOException,
ClassNotFoundException {
}
}
+ @Test
+ void byteArrayDefaultField() {
+ byte[] defaultBytes = new byte[] { 1, 2, 3 };
+ Schema.Field field = new Schema.Field("bytesField",
Schema.create(Schema.Type.BYTES), "my bytes field", defaultBytes);
+ Schema rSchema = Schema.createRecord("myRecord", "myRecord docs", "me",
false, List.of(field));
+ GenericData.Record rec = new GenericRecordBuilder(rSchema).build();
+ assertArrayEquals(((ByteBuffer) rec.get("bytesField")).array(),
defaultBytes);
Review Comment:
Swap the arguments so that it is `assertArrayEquals(expected, actual)`
##########
lang/java/avro/src/test/java/org/apache/avro/TestSchema.java:
##########
@@ -59,13 +60,7 @@
import org.junit.jupiter.api.Test;
import static java.util.Objects.requireNonNull;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertSame;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.*;
Review Comment:
Please revert this
--
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]