瀏覽代碼

Remove obsolete test for realm domain setting registration (#87630)

As part of feature flagging user profiles (#83347), we introduced
branching based on build type for setting
DOMAIN_TO_REALM_ASSOC_SETTING to enable easy downstream testing.
We've since removed the feature flag and the branching logic. The
outdated test fails for non-snapshot builds because the setting is now
always included. This PR removes the test since
DOMAIN_TO_REALM_ASSOC_SETTING is now a regular xpack setting like any
other.

Closes #87628
Nikolaj Volgushev 3 年之前
父節點
當前提交
608222d6f4
共有 1 個文件被更改,包括 0 次插入14 次删除
  1. 0 14
      x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/XPackSettingsTests.java

+ 0 - 14
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/XPackSettingsTests.java

@@ -6,7 +6,6 @@
  */
 package org.elasticsearch.xpack.core;
 
-import org.elasticsearch.Build;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.test.ESTestCase;
 
@@ -14,12 +13,10 @@ import java.security.NoSuchAlgorithmException;
 
 import javax.crypto.SecretKeyFactory;
 
-import static org.elasticsearch.xpack.core.security.authc.RealmSettings.DOMAIN_TO_REALM_ASSOC_SETTING;
 import static org.hamcrest.Matchers.contains;
 import static org.hamcrest.Matchers.containsString;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.hasItem;
-import static org.hamcrest.Matchers.hasSize;
 
 public class XPackSettingsTests extends ESTestCase {
 
@@ -103,17 +100,6 @@ public class XPackSettingsTests extends ESTestCase {
         assertThat(XPackSettings.SERVICE_TOKEN_HASHING_ALGORITHM.get(Settings.EMPTY), equalTo("PBKDF2_STRETCH"));
     }
 
-    // Whether the domain setting is registered by default depends on the build type
-    public void testRealmDomainSettingRegistrationDefault() {
-        assertThat(
-            XPackSettings.getAllSettings()
-                .stream()
-                .filter(setting -> setting.getKey().equals(DOMAIN_TO_REALM_ASSOC_SETTING.getKey()))
-                .toList(),
-            hasSize(Build.CURRENT.isSnapshot() ? 1 : 0)
-        );
-    }
-
     private boolean isSecretkeyFactoryAlgoAvailable(String algorithmId) {
         try {
             SecretKeyFactory.getInstance(algorithmId);