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/03/30 16:11:26 UTC
[GitHub] [pulsar] sijie commented on a change in pull request #10085: Fix NPE in KeyValue when the message payload is null
sijie commented on a change in pull request #10085:
URL: https://github.com/apache/pulsar/pull/10085#discussion_r604238949
##########
File path: pulsar-client/src/test/java/org/apache/pulsar/common/schema/KeyValueTest.java
##########
@@ -105,6 +106,18 @@ public void testAllSchemas(Map<Schema, List<Object>> schemas) {
}
}
+ @Test
+ public void testNullPayload() {
+ KeyValue kv = KeyValue.decode(
+ null,
+ (keyBytes, valueBytes) -> new KeyValue(
+ Schema.STRING.decode(keyBytes),
+ Schema.STRING.decode(valueBytes)
+ )
+ );
+ assertNotNull(kv);
Review comment:
Don't you need to assert the key & value of this `kv`?
##########
File path: pulsar-client/src/test/java/org/apache/pulsar/common/schema/KeyValueTest.java
##########
@@ -105,6 +106,18 @@ public void testAllSchemas(Map<Schema, List<Object>> schemas) {
}
}
+ @Test
+ public void testNullPayload() {
+ KeyValue kv = KeyValue.decode(
+ null,
Review comment:
Don't you need to test empty data array?
--
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