diff --git a/test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/FipsEnabledClusterConfigProvider.java b/test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/FipsEnabledClusterConfigProvider.java index 0978689aae56f..3341b20a89d3c 100644 --- a/test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/FipsEnabledClusterConfigProvider.java +++ b/test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/FipsEnabledClusterConfigProvider.java @@ -8,15 +8,10 @@ package org.elasticsearch.test.cluster.local; - -import org.elasticsearch.test.cluster.util.Version; import org.elasticsearch.test.cluster.util.resource.Resource; -import java.util.HashMap; - public class FipsEnabledClusterConfigProvider implements LocalClusterConfigProvider { - @Override public void apply(LocalClusterSpecBuilder builder) { if (isFipsEnabled()) { @@ -38,14 +33,8 @@ public void apply(LocalClusterSpecBuilder builder) { .setting("xpack.security.fips_mode.enabled", "true") .setting("xpack.license.self_generated.type", "trial") .setting("xpack.security.authc.password_hashing.algorithm", "pbkdf2_stretch") - .keystorePassword("keystore-password") - .settings(node -> { - var settings = new HashMap(1); - if(node.getVersion().onOrAfter(Version.fromString("8.13.0"))){ - settings.put("xpack.security.fips_mode.required_providers", "[BCFIPS, BCJSSE]"); - } - return settings; - }); + .setting("xpack.security.fips_mode.required_providers", () -> "[BCFIPS, BCJSSE]", n -> n.getVersion().onOrAfter("8.13.0")) + .keystorePassword("keystore-password"); } }