public SchemaRegistryClient get() {
    if (schemaRegistryUrl.equals("")) {
      return new DefaultSchemaRegistryClient();
    }
  
    final RestService restService = serviceSupplier.get();
    // This call sets a default sslSocketFactory.
    final SchemaRegistryClient client = schemaRegistryClientFactory.create(
        restService,
        1000,
        ImmutableList.of(
            new AvroSchemaProvider(), new ProtobufSchemaProvider(), new JsonSchemaProvider()),
        schemaRegistryClientConfigs,
        httpHeaders
    );

    // If we have an sslContext, we use it to set the sslSocketFactory on the restService client.
    //  We need to do it in this order so that the override here is not reset by the constructor
    //  above.
    if (sslContext != null) {
      restService.setSslSocketFactory(sslContext.getSocketFactory());
    }
    return client;
  }
@Test
  public void shouldUseDefaultSchemaRegistryClientWhenUrlNotSpecified() {
    // Given
    final KsqlConfig config1 = config();

    final Map<String, Object> schemaRegistryClientConfigs = ImmutableMap.of(
        "ksql.schema.registry.url", "     "
    );
    final KsqlConfig config2 = new KsqlConfig(schemaRegistryClientConfigs);

    // When:
    SchemaRegistryClient client1 = new KsqlSchemaRegistryClientFactory(
        config1, restServiceSupplier, SSL_CONTEXT, srClientFactory, Collections.emptyMap()).get();
    SchemaRegistryClient client2 = new KsqlSchemaRegistryClientFactory(
        config2, restServiceSupplier, SSL_CONTEXT, srClientFactory, Collections.emptyMap()).get();

    // Then:
    assertThat(client1, instanceOf(DefaultSchemaRegistryClient.class));
    assertThat(client2, instanceOf(DefaultSchemaRegistryClient.class));
  }