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/05/05 08:57:32 UTC

[GitHub] [pulsar] eolivelli commented on a change in pull request #10482: [CLIENT] fixed NPE in GenericJsonRecord

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



##########
File path: pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/JSONSchemaTest.java
##########
@@ -380,16 +382,15 @@ public void testEncodeAndDecodeObject() throws JsonProcessingException {
     }
 
     @Test
-    public void testGetNativeSchema() throws SchemaValidationException {
+    public void testGetNativeSchema() throws IllegalAccessException {
         JSONSchema<PC> schema2 = JSONSchema.of(PC.class);
-        org.apache.avro.Schema avroSchema2 = (Schema) schema2.getNativeSchema().get();
+        org.apache.avro.Schema avroSchema2 =
+                (Schema) schema2.getNativeSchema().orElseThrow(IllegalAccessException::new);

Review comment:
       this is a test case, I am not sure it is worth to complicate it.
   the test would fail anyway, we are only making the line longer IMHO




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