diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataTests.java index da50e99705d..a929028a34e 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataTests.java @@ -29,6 +29,7 @@ import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; +import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -794,4 +795,12 @@ public class MetaDataTests extends ESTestCase { " }\n" + " }\n" + "}"; + + public void testTransientSettingsOverridePersistentSettings() { + final Setting setting = Setting.simpleString("key"); + final MetaData metaData = MetaData.builder() + .persistentSettings(Settings.builder().put(setting.getKey(), "persistent-value").build()) + .transientSettings(Settings.builder().put(setting.getKey(), "transient-value").build()).build(); + assertThat(setting.get(metaData.settings()), equalTo("transient-value")); + } }