public EventHubsConfiguration getConfiguration() {
        return configuration;
    }
@Test
    public void testClientAutoDiscovery() {
        final EventHubsConfiguration configuration = new EventHubsConfiguration();
        configuration.setNamespace("test");
        configuration.setConsumerGroupName("testGroup");
        configuration.setSharedAccessKey("dummyKey");
        configuration.setSharedAccessName("dummyUser");

        final EventHubConsumerAsyncClient consumerAsyncClient
                = EventHubsClientFactory.createEventHubConsumerAsyncClient(configuration);
        final EventHubConsumerAsyncClient consumerAsyncClient2
                = EventHubsClientFactory.createEventHubConsumerAsyncClient(configuration);
        final EventHubProducerAsyncClient producerAsyncClient
                = EventHubsClientFactory.createEventHubProducerAsyncClient(configuration);

        // we dont allow more than one instance
        context.getRegistry().bind("consumerClient", consumerAsyncClient);
        context.getRegistry().bind("consumerClient2", consumerAsyncClient2);

        assertThrows(ResolveEndpointFailedException.class, () -> context.getEndpoint("azure-eventhubs:name/hubName"));

        context.getRegistry().bind("producerClient", producerAsyncClient);

        final EventHubsEndpoint endpoint
                = context.getEndpoint("azure-eventhubs:name/hubName?producerAsyncClient=#producerClient",
                        EventHubsEndpoint.class);

        assertSame(producerAsyncClient, endpoint.getConfiguration().getProducerAsyncClient());

        final DefaultAzureCredential tokenCredential = new DefaultAzureCredentialBuilder().build();
        context.getRegistry().bind("tokenCredential", tokenCredential);

        final EventHubsEndpoint endpoint2
                = context.getEndpoint("azure-eventhubs:name/hubName?tokenCredential=#tokenCredential", EventHubsEndpoint.class);

        assertSame(tokenCredential, endpoint2.getConfiguration().getTokenCredential());
    }