Skip to content

Commit e22a682

Browse files
authored
Tests: Make secure settings available from settings builder for tests (#25037)
This commit exposes the secure settings in Settings.Builder, so that the current secure settings can be retrieved and added to when creating settings for tests. This is necessary since secure settings can only be added once to a builder, so chains of methods using settings builders must reuse the already set mock secure settings.
1 parent 134b0d5 commit e22a682

File tree

1 file changed

+5
-0
lines changed
  • core/src/main/java/org/elasticsearch/common/settings

1 file changed

+5
-0
lines changed

core/src/main/java/org/elasticsearch/common/settings/Settings.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,11 @@ public String get(String key) {
721721
return map.get(key);
722722
}
723723

724+
/** Return the current secure settings, or {@code null} if none have been set. */
725+
public SecureSettings getSecureSettings() {
726+
return secureSettings.get();
727+
}
728+
724729
public Builder setSecureSettings(SecureSettings secureSettings) {
725730
if (secureSettings.isLoaded() == false) {
726731
throw new IllegalStateException("Secure settings must already be loaded");

0 commit comments

Comments
 (0)