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