This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit 1abbc3c0cf41ea1bb82c412fc10b475d6df73a00
Author: jiangpengcheng <[email protected]>
AuthorDate: Fri Jan 24 12:10:59 2025 +0800

    [improve][fn] Set default tenant and namespace for ListFunctions cmd 
(#23881)
    
    (cherry picked from commit 66d1bb0d734f12d758b0f0e9e3c0b42543508f8d)
---
 .../java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git 
a/pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java
 
b/pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java
index 39ede3bb7ae..7eaf0ad9bd6 100644
--- 
a/pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java
+++ 
b/pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java
@@ -632,6 +632,19 @@ public class CmdFunctionsTest {
         verify(functions, times(1)).getFunctions(eq(TENANT), eq(NAMESPACE));
     }
 
+    @Test
+    public void testListFunctionsWithDefaultValue() throws Exception {
+        cmd.run(new String[] {
+                "list",
+        });
+
+        ListFunctions lister = cmd.getLister();
+        assertEquals("public", lister.getTenant());
+        assertEquals("default", lister.getNamespace());
+
+        verify(functions, times(1)).getFunctions(eq("public"), eq("default"));
+    }
+
     @Test
     public void testStateGetter() throws Exception {
         String key = TEST_NAME + "-key";

Reply via email to