Search in sources :

Example 1 with DeleteFunction

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

the class CmdFunctionsTest method testDeleteFunction.

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

Aggregations

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