@@ -192,10 +192,24 @@ void producerDedicatedNamespaceShouldConfigureWithoutTopLevelConnectionInfo() {
192192 }
193193
194194 @ Test
195- void consumerDedicatedConnectionDetailsShouldConfigureWithoutTopLevelConnectionInfo () {
195+ void consumerDedicatedConnectionStringShouldConfigureWithoutTopLevelConnectionInfo () {
196196 this .contextRunner
197197 .withPropertyValues (
198198 "spring.cloud.azure.servicebus.consumer.connection-string=" + String .format (CONNECTION_STRING_FORMAT , "consumer-namespace" ),
199+ "spring.cloud.azure.servicebus.consumer.entity-name=test-queue" ,
200+ "spring.cloud.azure.servicebus.consumer.entity-type=queue"
201+ )
202+ .withBean (AzureGlobalProperties .class , AzureGlobalProperties ::new )
203+ .run (context -> {
204+ assertThat (context ).hasSingleBean (AzureServiceBusProperties .class );
205+ assertThat (context ).hasSingleBean (ServiceBusReceiverClient .class );
206+ });
207+ }
208+
209+ @ Test
210+ void consumerDedicatedNamespaceShouldConfigureWithoutTopLevelConnectionInfo () {
211+ this .contextRunner
212+ .withPropertyValues (
199213 "spring.cloud.azure.servicebus.consumer.namespace=consumer-namespace" ,
200214 "spring.cloud.azure.servicebus.consumer.entity-name=test-queue" ,
201215 "spring.cloud.azure.servicebus.consumer.entity-type=queue"
@@ -208,10 +222,26 @@ void consumerDedicatedConnectionDetailsShouldConfigureWithoutTopLevelConnectionI
208222 }
209223
210224 @ Test
211- void processorDedicatedConnectionDetailsShouldConfigureWithoutTopLevelConnectionInfo () {
225+ void processorDedicatedConnectionStringShouldConfigureWithoutTopLevelConnectionInfo () {
212226 this .contextRunner
213227 .withPropertyValues (
214228 "spring.cloud.azure.servicebus.processor.connection-string=" + String .format (CONNECTION_STRING_FORMAT , "processor-namespace" ),
229+ "spring.cloud.azure.servicebus.processor.entity-name=test-queue" ,
230+ "spring.cloud.azure.servicebus.processor.entity-type=queue"
231+ )
232+ .withBean (AzureGlobalProperties .class , AzureGlobalProperties ::new )
233+ .withBean (ServiceBusRecordMessageListener .class , () -> messageContext -> { })
234+ .withBean (ServiceBusErrorHandler .class , () -> errorContext -> { })
235+ .run (context -> {
236+ assertThat (context ).hasSingleBean (AzureServiceBusProperties .class );
237+ assertThat (context ).hasSingleBean (ServiceBusProcessorClient .class );
238+ });
239+ }
240+
241+ @ Test
242+ void processorDedicatedNamespaceShouldConfigureWithoutTopLevelConnectionInfo () {
243+ this .contextRunner
244+ .withPropertyValues (
215245 "spring.cloud.azure.servicebus.processor.namespace=processor-namespace" ,
216246 "spring.cloud.azure.servicebus.processor.entity-name=test-queue" ,
217247 "spring.cloud.azure.servicebus.processor.entity-type=queue"
0 commit comments