You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "jsancio (via GitHub)" <gi...@apache.org> on 2023/03/08 19:45:55 UTC

[GitHub] [kafka] jsancio commented on a diff in pull request #13363: KAFKA-14794; Decode base64 JSON string

jsancio commented on code in PR #13363:
URL: https://github.com/apache/kafka/pull/13363#discussion_r1129947176


##########
clients/src/test/java/org/apache/kafka/common/protocol/MessageUtilTest.java:
##########
@@ -83,4 +90,31 @@ public void testConstants() {
         assertEquals(MessageUtil.UNSIGNED_SHORT_MAX, 0xFFFF);
         assertEquals(MessageUtil.UNSIGNED_INT_MAX, 0xFFFFFFFFL);
     }
+
+    @Test
+    public void testBinaryNode() throws IOException {
+        byte[] expected = new byte[] {5, 2, 9, 4, 1, 8, 7, 0, 3, 6};
+        StringWriter writer = new StringWriter();
+        ObjectMapper mapper = new ObjectMapper();
+
+        mapper.writeTree(mapper.createGenerator(writer), new BinaryNode(expected));
+
+        JsonNode binaryNode = mapper.readTree(writer.toString());
+
+        assertTrue(binaryNode.isTextual(), binaryNode.toString());

Review Comment:
   Fixed.



-- 
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: jira-unsubscribe@kafka.apache.org

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