Search in sources :

Example 1 with GetFunction

use of org.apache.pulsar.admin.cli.CmdFunctions.GetFunction in project incubator-pulsar by apache.

the class CmdFunctionsTest method testGetFunction.

@Test
public void testGetFunction() throws Exception {
    String tenant = TEST_NAME + "-tenant";
    String namespace = TEST_NAME + "-namespace";
    String fnName = TEST_NAME + "-function";
    cmd.run(new String[] { "get", "--name", fnName, "--tenant", tenant, "--namespace", namespace });
    GetFunction getter = cmd.getGetter();
    assertEquals(fnName, getter.getFunctionName());
    assertEquals(tenant, getter.getTenant());
    assertEquals(namespace, getter.getNamespace());
    verify(functions, times(1)).getFunction(eq(tenant), eq(namespace), eq(fnName));
}
Also used : Matchers.anyString(org.mockito.Matchers.anyString) GetFunction(org.apache.pulsar.admin.cli.CmdFunctions.GetFunction) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

GetFunction (org.apache.pulsar.admin.cli.CmdFunctions.GetFunction)1 Matchers.anyString (org.mockito.Matchers.anyString)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1 Test (org.testng.annotations.Test)1