|
5 | 5 | */
|
6 | 6 | package org.elasticsearch.xpack.core.ssl;
|
7 | 7 |
|
| 8 | +import org.elasticsearch.common.settings.Setting; |
8 | 9 | import org.elasticsearch.common.settings.Settings;
|
9 | 10 | import org.elasticsearch.test.ESTestCase;
|
10 | 11 |
|
11 | 12 | import javax.net.ssl.KeyManagerFactory;
|
12 | 13 | import javax.net.ssl.TrustManagerFactory;
|
13 |
| - |
14 | 14 | import java.util.Arrays;
|
15 | 15 |
|
| 16 | +import static org.hamcrest.Matchers.instanceOf; |
16 | 17 | import static org.hamcrest.Matchers.is;
|
| 18 | +import static org.hamcrest.Matchers.startsWith; |
17 | 19 |
|
18 | 20 | public class SSLConfigurationSettingsTests extends ESTestCase {
|
19 | 21 |
|
@@ -91,4 +93,19 @@ public void testEmptySettingsParsesToDefaults() {
|
91 | 93 | assertThat(SSLConfigurationSettings.getKeyStoreType(ssl.truststoreType, settings, null), is("jks"));
|
92 | 94 | }
|
93 | 95 |
|
| 96 | + public void testRealmSettingPrefixes() { |
| 97 | + SSLConfigurationSettings.getRealmSettings("_type").forEach(affix -> { |
| 98 | + final String key = affix.getConcreteSettingForNamespace("_name").getKey(); |
| 99 | + assertThat(key, startsWith("xpack.security.authc.realms._type._name.ssl.")); |
| 100 | + }); |
| 101 | + } |
| 102 | + |
| 103 | + public void testProfileSettingPrefixes() { |
| 104 | + SSLConfigurationSettings.getProfileSettings().forEach(affix -> { |
| 105 | + assertThat(affix, instanceOf(Setting.AffixSetting.class)); |
| 106 | + final String key = ((Setting.AffixSetting) affix).getConcreteSettingForNamespace("_name").getKey(); |
| 107 | + assertThat(key, startsWith("transport.profiles._name.xpack.security.ssl.")); |
| 108 | + }); |
| 109 | + } |
| 110 | + |
94 | 111 | }
|
0 commit comments