Example usage for com.rabbitmq.client ConnectionFactory getPassword

List of usage examples for com.rabbitmq.client ConnectionFactory getPassword

Introduction

In this page you can find the example usage for com.rabbitmq.client ConnectionFactory getPassword.

Prototype

public String getPassword() 

Source Link

Document

Retrieve the password.

Usage

From source file:zipkin2.autoconfigure.collector.rabbitmq.ZipkinRabbitMQCollectorPropertiesTest.java

License:Apache License

@Test
public void uriProperlyParsedAndIgnoresOtherProperties_whenUriSet() throws Exception {
    properties.setUri(URI.create("amqp://admin:admin@localhost:5678/myv"));
    properties.setAddresses(Collections.singletonList("will_not^work!"));
    properties.setUsername("bob");
    properties.setPassword("letmein");
    properties.setVirtualHost("drwho");

    assertThat(properties.toBuilder()).extracting("connectionFactory").allSatisfy(object -> {
        ConnectionFactory connFactory = (ConnectionFactory) object;
        assertThat(connFactory.getHost()).isEqualTo("localhost");
        assertThat(connFactory.getPort()).isEqualTo(5678);
        assertThat(connFactory.getUsername()).isEqualTo("admin");
        assertThat(connFactory.getPassword()).isEqualTo("admin");
        assertThat(connFactory.getVirtualHost()).isEqualTo("myv");
    });/*from   w w w  . ja va  2  s . c  om*/
}