### Question:
KsqlSchemaRegistryClientFactory { public SchemaRegistryClient create() { final RestService restService = serviceSupplier.get(); final SSLContext sslContext = sslFactory.sslContext(); if (sslContext != null) { restService.setSslSocketFactory(sslContext.getSocketFactory()); } return new CachedSchemaRegistryClient(restService, 1000); } KsqlSchemaRegistryClientFactory(final KsqlConfig config);   KsqlSchemaRegistryClientFactory(final KsqlConfig config,
                                  final Supplier<RestService> serviceSupplier,
                                  final SslFactory sslFactory); SchemaRegistryClient create();  }### Answer:
@Test public void shouldSetSocketFactoryWhenNoSpecificSslConfig() { final KsqlConfig config = config(); final Map<String, Object> expectedConfigs = defaultConfigs(); setUpMocksWithExpectedConfig(expectedConfigs); final SchemaRegistryClient client = new KsqlSchemaRegistryClientFactory(config, restServiceSupplier, sslFactory).create(); assertThat(client, is(notNullValue())); EasyMock.verify(restService); }
@Test public void shouldPickUpNonPrefixedSslConfig() { final KsqlConfig config = config( SslConfigs.SSL_PROTOCOL_CONFIG, "SSLv3" ); final Map<String, Object> expectedConfigs = defaultConfigs(); expectedConfigs.put(SslConfigs.SSL_PROTOCOL_CONFIG, "SSLv3"); setUpMocksWithExpectedConfig(expectedConfigs); final SchemaRegistryClient client = new KsqlSchemaRegistryClientFactory(config, restServiceSupplier, sslFactory).create(); assertThat(client, is(notNullValue())); EasyMock.verify(restService); }
@Test public void shouldPickUpPrefixedSslConfig() { final KsqlConfig config = config( "ksql.schema.registry." + SslConfigs.SSL_PROTOCOL_CONFIG, "SSLv3" ); final Map<String, Object> expectedConfigs = defaultConfigs(); expectedConfigs.put(SslConfigs.SSL_PROTOCOL_CONFIG, "SSLv3"); setUpMocksWithExpectedConfig(expectedConfigs); final SchemaRegistryClient client = new KsqlSchemaRegistryClientFactory(config, restServiceSupplier, sslFactory).create(); assertThat(client, is(notNullValue())); EasyMock.verify(restService); }