@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 consumerHandlesClientError() throws Exception {
        try (ServiceBusConsumer consumer = new ServiceBusConsumer(endpoint, processor)) {
            consumer.doStart();
            verify(client).start();
            verify(clientFactory).createServiceBusProcessorClient(any(), any(), any());

            ServiceBusErrorContext errorContext = mock();
            when(errorContext.getErrorSource()).thenReturn(ServiceBusErrorSource.UNKNOWN);
            when(errorContext.getException()).thenReturn(new Exception("Test exception"));

            processErrorCaptor.getValue().accept(errorContext);

            verifyNoInteractions(processor);
        }
    }