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");
}
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();
}
Aggregations