Search in sources :

Example 1 with Brokers

use of com.yahoo.pulsar.client.admin.Brokers in project pulsar by yahoo.

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");
}
Also used : PulsarAdmin(com.yahoo.pulsar.client.admin.PulsarAdmin) Brokers(com.yahoo.pulsar.client.admin.Brokers) Test(org.testng.annotations.Test)

Example 2 with Brokers

use of com.yahoo.pulsar.client.admin.Brokers in project pulsar by yahoo.

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(com.yahoo.pulsar.client.admin.PulsarAdmin) Brokers(com.yahoo.pulsar.client.admin.Brokers) Test(org.testng.annotations.Test)

Aggregations

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