You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/29 09:36:47 UTC

[GitHub] [pulsar] eolivelli commented on a change in pull request #10428: [Issue #10427] Add AvroSchema UUID support fix

eolivelli commented on a change in pull request #10428:
URL: https://github.com/apache/pulsar/pull/10428#discussion_r622887818



##########
File path: pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java
##########
@@ -423,4 +425,16 @@ public void testAvroSchemaUserDefinedReadAndWriter() {
         assertEquals(field1, foo.getField1());
     }
 
+    static class MyPojo {
+        public UUID uid;

Review comment:
       can you please add a case for `DecimalConversion`as well ?
   

##########
File path: pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java
##########
@@ -423,4 +425,16 @@ public void testAvroSchemaUserDefinedReadAndWriter() {
         assertEquals(field1, foo.getField1());
     }
 
+    static class MyPojo {
+        public UUID uid;
+    }
+
+    @Test
+    public void testAvroUUID() {
+        org.apache.pulsar.client.api.Schema schema = org.apache.pulsar.client.api.Schema.AVRO(MyPojo.class);
+        MyPojo pojo = new MyPojo();
+        pojo.uid = UUID.randomUUID();
+        schema.encode(pojo);

Review comment:
       can we also `decode` ? and verify the result ?




-- 
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.

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