@SuppressWarnings("checkstyle:BooleanExpressionComplexity")
  public static Optional<KeyStoreOptions> getBcfksTrustStoreOptions(
      final Map<String, String> props) {
    final String location = getTrustStoreLocation(props);
    final String password = getTrustStorePassword(props);
    final String trustManagerAlgorithm = getTrustManagerAlgorithm(props);

    final String securityProviders = getSecurityProviders(props);

    if (Strings.isNullOrEmpty(location)
        || Strings.isNullOrEmpty(password)
        || Strings.isNullOrEmpty(trustManagerAlgorithm)
        || Strings.isNullOrEmpty(securityProviders)) {
      return Optional.empty();
    }

    specifySecurityProperties(securityProviders, trustManagerAlgorithm, false);
    return Optional.of(buildBcfksOptions(location, password, ""));
  }
@Test
  public void shouldBuildTrustStoreBCFKSOptionsWithEssentialFields() {
    // When
    final Optional<KeyStoreOptions> trustStoreOptions = VertxSslOptionsFactory.getBcfksTrustStoreOptions(
        ImmutableMap.of(
            SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, "location",
            SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, "password",
            SslConfigs.SSL_TRUSTMANAGER_ALGORITHM_CONFIG, "algorithm",
            SecurityConfig.SECURITY_PROVIDERS_CONFIG, "security-providers-list"
        )
    );

    // Then
    assertThat(trustStoreOptions.isPresent(), equalTo(true));
    assertThat(trustStoreOptions.get().getPath(), is("location"));
    assertThat(trustStoreOptions.get().getPassword(), is("password"));
    assertThat(Security.getProperty("ssl.TrustManagerFactory.algorithm"), is("algorithm"));
    assertThat(Security.getProperty("security.providers"), is("security-providers-list"));
  }