|
25 | 25 |
|
26 | 26 | public class XPackPluginTests extends ESTestCase { |
27 | 27 |
|
28 | | - public void testXPackInstalledAttrClashOnTransport() throws Exception { |
| 28 | + public void testXPackInstalledAttrClash() throws Exception { |
29 | 29 | Settings.Builder builder = Settings.builder(); |
30 | | - builder.put("node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR, "true"); |
31 | | - builder.put(Client.CLIENT_TYPE_SETTING_S.getKey(), "transport"); |
| 30 | + builder.put("node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR, randomBoolean()); |
| 31 | + if (randomBoolean()) { |
| 32 | + builder.put(Client.CLIENT_TYPE_SETTING_S.getKey(), "transport"); |
| 33 | + } |
32 | 34 | XPackPlugin xpackPlugin = createXPackPlugin(builder.put("path.home", createTempDir()).build()); |
33 | 35 | IllegalArgumentException e = expectThrows(IllegalArgumentException.class, xpackPlugin::additionalSettings); |
34 | 36 | assertThat(e.getMessage(), |
35 | 37 | containsString("Directly setting [node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR + "] is not permitted")); |
36 | 38 | } |
37 | 39 |
|
38 | | - public void testXPackInstalledAttrClashOnNode() throws Exception { |
39 | | - Settings.Builder builder = Settings.builder(); |
40 | | - builder.put("node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR, "false"); |
41 | | - XPackPlugin xpackPlugin = createXPackPlugin(builder.put("path.home", createTempDir()).build()); |
42 | | - IllegalArgumentException e = expectThrows(IllegalArgumentException.class, xpackPlugin::additionalSettings); |
43 | | - assertThat(e.getMessage(), |
44 | | - containsString("Conflicting setting [node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR + "]")); |
45 | | - } |
46 | | - |
47 | 40 | public void testXPackInstalledAttrExists() throws Exception { |
48 | 41 | XPackPlugin xpackPlugin = createXPackPlugin(Settings.builder().put("path.home", createTempDir()).build()); |
49 | 42 | assertEquals("true", xpackPlugin.additionalSettings().get("node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR)); |
|
0 commit comments