|
|
|
@ -81,6 +81,7 @@ import static org.mockito.Mockito.verify;
|
|
|
|
|
* @author Stephane Nicoll
|
|
|
|
|
* @author Gary Russell
|
|
|
|
|
* @author HaiTao Zhang
|
|
|
|
|
* @author Franjo Zilic
|
|
|
|
|
*/
|
|
|
|
|
class RabbitAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
@ -99,6 +100,8 @@ class RabbitAutoConfigurationTests {
|
|
|
|
|
assertThat(messagingTemplate.getRabbitTemplate()).isEqualTo(rabbitTemplate);
|
|
|
|
|
assertThat(amqpAdmin).isNotNull();
|
|
|
|
|
assertThat(connectionFactory.getHost()).isEqualTo("localhost");
|
|
|
|
|
assertThat(getTargetConnectionFactory(context).getRequestedChannelMax())
|
|
|
|
|
.isEqualTo(com.rabbitmq.client.ConnectionFactory.DEFAULT_CHANNEL_MAX);
|
|
|
|
|
assertThat(connectionFactory.isPublisherConfirms()).isFalse();
|
|
|
|
|
assertThat(connectionFactory.isPublisherReturns()).isFalse();
|
|
|
|
|
assertThat(context.containsBean("rabbitListenerContainerFactory"))
|
|
|
|
@ -600,6 +603,15 @@ class RabbitAutoConfigurationTests {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void customizeRequestedChannelMax() {
|
|
|
|
|
this.contextRunner.withUserConfiguration(TestConfiguration.class)
|
|
|
|
|
.withPropertyValues("spring.rabbitmq.requestedChannelMax:12").run((context) -> {
|
|
|
|
|
com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory = getTargetConnectionFactory(context);
|
|
|
|
|
assertThat(rabbitConnectionFactory.getRequestedChannelMax()).isEqualTo(12);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void noSslByDefault() {
|
|
|
|
|
this.contextRunner.withUserConfiguration(TestConfiguration.class).run((context) -> {
|
|
|
|
|