Search in sources :

Example 1 with Brokers

use of org.apache.pulsar.client.admin.Brokers in project incubator-pulsar by apache.

the class PulsarAdminToolTest method getOwnedNamespaces.

@Test
void getOwnedNamespaces() throws Exception {
    PulsarAdmin admin = Mockito.mock(PulsarAdmin.class);
    Brokers mockBrokers = mock(Brokers.class);
    doReturn(mockBrokers).when(admin).brokers();
    CmdBrokers brokers = new CmdBrokers(admin);
    brokers.run(split("namespaces use --url http://my-service.url:4000"));
    verify(mockBrokers).getOwnedNamespaces("use", "http://my-service.url:4000");
}
Also used : PulsarAdmin(org.apache.pulsar.client.admin.PulsarAdmin) Brokers(org.apache.pulsar.client.admin.Brokers) Test(org.testng.annotations.Test)

Example 2 with Brokers

use of org.apache.pulsar.client.admin.Brokers in project incubator-pulsar by apache.

the class PulsarAdminToolTest method brokers.

@Test
void brokers() throws Exception {
    PulsarAdmin admin = Mockito.mock(PulsarAdmin.class);
    Brokers mockBrokers = mock(Brokers.class);
    doReturn(mockBrokers).when(admin).brokers();
    CmdBrokers brokers = new CmdBrokers(admin);
    brokers.run(split("list use"));
    verify(mockBrokers).getActiveBrokers("use");
    brokers.run(split("get-all-dynamic-config"));
    verify(mockBrokers).getAllDynamicConfigurations();
    brokers.run(split("list-dynamic-config"));
    verify(mockBrokers).getDynamicConfigurationNames();
    brokers.run(split("update-dynamic-config --config brokerShutdownTimeoutMs --value 100"));
    verify(mockBrokers).updateDynamicConfiguration("brokerShutdownTimeoutMs", "100");
    brokers.run(split("get-internal-config"));
    verify(mockBrokers).getInternalConfigurationData();
}
Also used : PulsarAdmin(org.apache.pulsar.client.admin.PulsarAdmin) Brokers(org.apache.pulsar.client.admin.Brokers) Test(org.testng.annotations.Test)

Aggregations

Brokers (org.apache.pulsar.client.admin.Brokers)2 PulsarAdmin (org.apache.pulsar.client.admin.PulsarAdmin)2 Test (org.testng.annotations.Test)2