coderzc commented on code in PR #22690:
URL: https://github.com/apache/pulsar/pull/22690#discussion_r1604623450


##########
pulsar-broker/src/test/java/org/apache/pulsar/utils/auth/tokens/TokensCliUtilsTest.java:
##########
@@ -31,6 +36,37 @@
  */
 public class TokensCliUtilsTest {
 
+    @Test
+    public void testCreateToken() {
+        PrintStream oldStream = System.out;
+        try {
+            ByteArrayOutputStream baoStream = new ByteArrayOutputStream();
+            System.setOut(new PrintStream(baoStream));
+
+            new TokensCliUtils().execute(new String[]{"create-secret-key", 
"--base64"});
+            String secretKey = baoStream.toString();
+
+            baoStream.reset();
+
+            new TokensCliUtils().execute(new String[]{"create", 
"--secret-key", "data:;base64," + secretKey, "--subject", "test", "--headers", 
"kid=test"});

Review Comment:
   done



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

Reply via email to