use of com.rabbitmq.stream.EnvironmentBuilder in project spring-boot by spring-projects.
the class RabbitStreamConfigurationTests method whenStreamCredentialsAreSetThenEnvironmentUsesStreamCredentials.
@Test
void whenStreamCredentialsAreSetThenEnvironmentUsesStreamCredentials() {
EnvironmentBuilder builder = mock(EnvironmentBuilder.class);
RabbitProperties properties = new RabbitProperties();
properties.setUsername("alice");
properties.setPassword("secret");
properties.getStream().setUsername("bob");
properties.getStream().setPassword("confidential");
RabbitStreamConfiguration.configure(builder, properties);
then(builder).should().username("bob");
then(builder).should().password("confidential");
}
use of com.rabbitmq.stream.EnvironmentBuilder in project spring-boot by spring-projects.
the class RabbitStreamConfigurationTests method whenStreamHostIsSetThenEnvironmentUsesCustomHost.
@Test
void whenStreamHostIsSetThenEnvironmentUsesCustomHost() {
EnvironmentBuilder builder = mock(EnvironmentBuilder.class);
RabbitProperties properties = new RabbitProperties();
properties.getStream().setHost("stream.rabbit.example.com");
RabbitStreamConfiguration.configure(builder, properties);
then(builder).should().host("stream.rabbit.example.com");
}
use of com.rabbitmq.stream.EnvironmentBuilder in project spring-boot by spring-projects.
the class RabbitStreamConfigurationTests method whenStreamPortIsSetThenEnvironmentUsesCustomPort.
@Test
void whenStreamPortIsSetThenEnvironmentUsesCustomPort() {
EnvironmentBuilder builder = mock(EnvironmentBuilder.class);
RabbitProperties properties = new RabbitProperties();
properties.getStream().setPort(5553);
RabbitStreamConfiguration.configure(builder, properties);
then(builder).should().port(5553);
}
use of com.rabbitmq.stream.EnvironmentBuilder in project spring-boot by spring-projects.
the class RabbitStreamConfigurationTests method whenStreamCredentialsAreNotSetThenEnvironmentUsesRabbitCredentials.
@Test
void whenStreamCredentialsAreNotSetThenEnvironmentUsesRabbitCredentials() {
EnvironmentBuilder builder = mock(EnvironmentBuilder.class);
RabbitProperties properties = new RabbitProperties();
properties.setUsername("alice");
properties.setPassword("secret");
RabbitStreamConfiguration.configure(builder, properties);
then(builder).should().username("alice");
then(builder).should().password("secret");
}
use of com.rabbitmq.stream.EnvironmentBuilder in project rabbitmq-stream-java-client by rabbitmq.
the class StreamEnvironmentTest method environmentCreationShouldSucceedWhenUsingTls.
@DisabledIfTlsNotEnabled
@Test
void environmentCreationShouldSucceedWhenUsingTls() {
ChannelCustomizer channelCustomizer = ch -> {
SslHandler sslHandler = ch.pipeline().get(SslHandler.class);
if (sslHandler != null) {
SSLParameters sslParameters = sslHandler.engine().getSSLParameters();
sslParameters.setServerNames(Collections.singletonList(new SNIHostName("localhost")));
sslHandler.engine().setSSLParameters(sslParameters);
}
};
environmentBuilder.uri("rabbitmq-stream+tls://guest:guest@localhost:5551/%2f").channelCustomizer(channelCustomizer).tls().trustEverything().environmentBuilder().build().close();
}
Aggregations