Search in sources :

Example 1 with NonPersistentTopics

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

the class PulsarAdminToolTest method nonPersistentTopics.

@Test
void nonPersistentTopics() throws Exception {
    PulsarAdmin admin = Mockito.mock(PulsarAdmin.class);
    NonPersistentTopics mockTopics = mock(NonPersistentTopics.class);
    when(admin.nonPersistentTopics()).thenReturn(mockTopics);
    CmdNonPersistentTopics topics = new CmdNonPersistentTopics(admin);
    topics.run(split("stats non-persistent://myprop/clust/ns1/ds1"));
    verify(mockTopics).getStats("non-persistent://myprop/clust/ns1/ds1");
    topics.run(split("stats-internal non-persistent://myprop/clust/ns1/ds1"));
    verify(mockTopics).getInternalStats("non-persistent://myprop/clust/ns1/ds1");
    topics.run(split("create-partitioned-topic non-persistent://myprop/clust/ns1/ds1 --partitions 32"));
    verify(mockTopics).createPartitionedTopic("non-persistent://myprop/clust/ns1/ds1", 32);
    topics.run(split("list myprop/clust/ns1"));
    verify(mockTopics).getList("myprop/clust/ns1");
    topics.run(split("list-in-bundle myprop/clust/ns1 --bundle 0x23d70a30_0x26666658"));
    verify(mockTopics).getListInBundle("myprop/clust/ns1", "0x23d70a30_0x26666658");
}
Also used : NonPersistentTopics(org.apache.pulsar.client.admin.NonPersistentTopics) PulsarAdmin(org.apache.pulsar.client.admin.PulsarAdmin) Test(org.testng.annotations.Test)

Aggregations

NonPersistentTopics (org.apache.pulsar.client.admin.NonPersistentTopics)1 PulsarAdmin (org.apache.pulsar.client.admin.PulsarAdmin)1 Test (org.testng.annotations.Test)1