Search in sources :

Example 1 with PulsarFactory

use of com.yahoo.athenz.common.messaging.pulsar.PulsarFactory in project athenz by yahoo.

the class PulsarFactoryTest method test_publisher_creation.

@Test
public void test_publisher_creation() {
    System.setProperty(PROP_MESSAGING_CLI_SERVICE_URL, "some-service");
    System.setProperty(PROP_MESSAGING_CLI_CERT_PATH, "cert");
    System.setProperty(PROP_MESSAGING_CLI_KEY_PATH, "key");
    System.setProperty(PROP_MESSAGING_CLI_TRUST_STORE_PATH, "trust");
    PulsarFactory<DomainChangeMessage> factory = new PulsarFactory<>();
    PulsarChangePublisher<DomainChangeMessage> publisher = (PulsarChangePublisher<DomainChangeMessage>) factory.create(null, "topic");
    publisher.publish(new DomainChangeMessage());
    assertNotNull(getPulsarProducer(publisher));
    System.clearProperty(PROP_MESSAGING_CLI_SERVICE_URL);
    System.clearProperty(PROP_MESSAGING_CLI_CERT_PATH);
    System.clearProperty(PROP_MESSAGING_CLI_KEY_PATH);
    System.clearProperty(PROP_MESSAGING_CLI_TRUST_STORE_PATH);
}
Also used : DomainChangeMessage(com.yahoo.athenz.common.messaging.DomainChangeMessage) PulsarFactory(com.yahoo.athenz.common.messaging.pulsar.PulsarFactory) Test(org.testng.annotations.Test)

Aggregations

DomainChangeMessage (com.yahoo.athenz.common.messaging.DomainChangeMessage)1 PulsarFactory (com.yahoo.athenz.common.messaging.pulsar.PulsarFactory)1 Test (org.testng.annotations.Test)1