Skip to content

Commit

Permalink
Tests: Make secure settings available from settings builder for tests (
Browse files Browse the repository at this point in the history
…#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.
  • Loading branch information
rjernst committed Jun 3, 2017
1 parent 4ed3fd8 commit 96e9ee7
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -697,6 +697,11 @@ public String get(String key) {
return map.get(key);
}

/** Return the current secure settings, or {@code null} if none have been set. */
public SecureSettings getSecureSettings() {
return secureSettings.get();
}

public Builder setSecureSettings(SecureSettings secureSettings) {
if (secureSettings.isLoaded() == false) {
throw new IllegalStateException("Secure settings must already be loaded");
Expand Down

0 comments on commit 96e9ee7

Please sign in to comment.