Search in sources :

Example 1 with SSLCertificateAuthenticationMethod

use of com.redhat.jenkins.plugins.ci.authentication.rabbitmq.SSLCertificateAuthenticationMethod in project jms-messaging-plugin by jenkinsci.

the class JcascTest method load.

@Test
@ConfiguredWithCode("JcascTest/casc.yaml")
public void load() {
    GlobalCIConfiguration gc = GlobalCIConfiguration.get();
    FedMsgMessagingProvider fedMsg = (FedMsgMessagingProvider) gc.getProvider("Fedora messages");
    assertEquals("org.fedora.bar", fedMsg.getTopic());
    assertEquals("tcp://example.com:5678", fedMsg.getHubAddr());
    assertEquals("tcp://example.com:6789", fedMsg.getPubAddr());
    ActiveMqMessagingProvider amq = (ActiveMqMessagingProvider) gc.getProvider("Active MQ");
    assertEquals("foo.com:4242", amq.getBroker());
    assertEquals("active.mq.com", amq.getTopic());
    assertThat(amq.getTopicProvider(), Matchers.instanceOf(DefaultTopicProvider.class));
    assertEquals(false, amq.getUseQueues());
    UsernameAuthenticationMethod amqam = (UsernameAuthenticationMethod) amq.getAuthenticationMethod();
    assertEquals("foo", amqam.getUsername());
    assertEquals("bar", amqam.getPassword().getPlainText());
    RabbitMQMessagingProvider rmq = (RabbitMQMessagingProvider) gc.getProvider("Rabbit MQ");
    assertEquals("ex", rmq.getExchange());
    assertEquals("rabbitmq.example.com", rmq.getHostname());
    assertEquals(4545, rmq.getPortNumber().intValue());
    assertEquals("foo.bar", rmq.getQueue());
    assertEquals("baz", rmq.getTopic());
    assertEquals("rabbitvh.example.com", rmq.getVirtualHost());
    SSLCertificateAuthenticationMethod rmqam = (SSLCertificateAuthenticationMethod) rmq.getAuthenticationMethod();
    assertEquals("/tmp/key", rmqam.getKeystore());
    assertEquals("/tmp/trust", rmqam.getTruststore());
    assertEquals("keypwd", rmqam.getKeypwd().getPlainText());
    assertEquals("trustpwd", rmqam.getTrustpwd().getPlainText());
}
Also used : ActiveMqMessagingProvider(com.redhat.jenkins.plugins.ci.messaging.ActiveMqMessagingProvider) RabbitMQMessagingProvider(com.redhat.jenkins.plugins.ci.messaging.RabbitMQMessagingProvider) DefaultTopicProvider(com.redhat.jenkins.plugins.ci.messaging.topics.DefaultTopicProvider) UsernameAuthenticationMethod(com.redhat.jenkins.plugins.ci.authentication.activemq.UsernameAuthenticationMethod) SSLCertificateAuthenticationMethod(com.redhat.jenkins.plugins.ci.authentication.rabbitmq.SSLCertificateAuthenticationMethod) FedMsgMessagingProvider(com.redhat.jenkins.plugins.ci.messaging.FedMsgMessagingProvider) Test(org.junit.Test) ConfiguredWithCode(io.jenkins.plugins.casc.misc.ConfiguredWithCode)

Aggregations

UsernameAuthenticationMethod (com.redhat.jenkins.plugins.ci.authentication.activemq.UsernameAuthenticationMethod)1 SSLCertificateAuthenticationMethod (com.redhat.jenkins.plugins.ci.authentication.rabbitmq.SSLCertificateAuthenticationMethod)1 ActiveMqMessagingProvider (com.redhat.jenkins.plugins.ci.messaging.ActiveMqMessagingProvider)1 FedMsgMessagingProvider (com.redhat.jenkins.plugins.ci.messaging.FedMsgMessagingProvider)1 RabbitMQMessagingProvider (com.redhat.jenkins.plugins.ci.messaging.RabbitMQMessagingProvider)1 DefaultTopicProvider (com.redhat.jenkins.plugins.ci.messaging.topics.DefaultTopicProvider)1 ConfiguredWithCode (io.jenkins.plugins.casc.misc.ConfiguredWithCode)1 Test (org.junit.Test)1