@Override
    protected void doStart() throws Exception {
        super.doStart();

        LOG.debug("Creating connection to Azure ServiceBus");
        client = getEndpoint().getServiceBusClientFactory().createServiceBusProcessorClient(getConfiguration(),
                this::processMessage, this::processError);
        client.start();
    }
@Test
    void synchronizationCallsExceptionHandlerOnFailure() throws Exception {
        try (ServiceBusConsumer consumer = new ServiceBusConsumer(endpoint, processor)) {
            consumer.setExceptionHandler(exceptionHandler);
            consumer.doStart();
            verify(client).start();
            verify(clientFactory).createServiceBusProcessorClient(any(), any(), any());

            when(messageContext.getMessage()).thenReturn(message);

            processMessageCaptor.getValue().accept(messageContext);

            verify(processor).process(any(Exchange.class), any(AsyncCallback.class));
            Exchange exchange = exchangeCaptor.getValue();
            assertThat(exchange).isNotNull();

            final Exception testException = new Exception("Test exception");
            exchange.setException(testException);
            Synchronization synchronization = exchange.getExchangeExtension().handoverCompletions().get(0);
            synchronization.onFailure(exchange);
            verify(exceptionHandler).handleException(anyString(), eq(exchange), eq(testException));
        }
    }