lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject [11/50] lucene-solr:feature/autoscaling_72: SOLR-10783: Fix constructor.
Date Mon, 18 Sep 2017 16:24:45 GMT
SOLR-10783: Fix constructor.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/93882086
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/93882086
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/93882086

Branch: refs/heads/feature/autoscaling_72
Commit: 938820861334c6ad1de5efc520d78ac3fec71981
Parents: f828edf
Author: Mark Miller <markrmiller@apache.org>
Authored: Thu Sep 7 14:46:51 2017 -0500
Committer: Mark Miller <markrmiller@apache.org>
Committed: Thu Sep 7 14:46:57 2017 -0500

----------------------------------------------------------------------
 .../providers/EnvSSLCredentialProvider.java              |  4 ++++
 .../providers/EnvSSLCredentialProviderTest.java          |  9 +++++++++
 .../providers/SysPropSSLCredentialProviderTest.java      | 11 +++++++++++
 3 files changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/93882086/solr/core/src/java/org/apache/solr/util/configuration/providers/EnvSSLCredentialProvider.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/configuration/providers/EnvSSLCredentialProvider.java
b/solr/core/src/java/org/apache/solr/util/configuration/providers/EnvSSLCredentialProvider.java
index ccfd807..6641cfe 100644
--- a/solr/core/src/java/org/apache/solr/util/configuration/providers/EnvSSLCredentialProvider.java
+++ b/solr/core/src/java/org/apache/solr/util/configuration/providers/EnvSSLCredentialProvider.java
@@ -44,6 +44,10 @@ public class EnvSSLCredentialProvider extends AbstractSSLCredentialProvider
{
 
   private Map<String, String> envVars;
 
+  public EnvSSLCredentialProvider() {
+    this.envVars = System.getenv();
+  }
+
   protected EnumMap<CredentialType, String> getCredentialKeyMap() {
     return Maps.newEnumMap(ImmutableMap.of(
         SSL_KEY_STORE_PASSWORD, EnvVars.SOLR_SSL_KEY_STORE_PASSWORD,

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/93882086/solr/core/src/test/org/apache/solr/util/configuration/providers/EnvSSLCredentialProviderTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/configuration/providers/EnvSSLCredentialProviderTest.java
b/solr/core/src/test/org/apache/solr/util/configuration/providers/EnvSSLCredentialProviderTest.java
index c355dce..2b85e7d 100644
--- a/solr/core/src/test/org/apache/solr/util/configuration/providers/EnvSSLCredentialProviderTest.java
+++ b/solr/core/src/test/org/apache/solr/util/configuration/providers/EnvSSLCredentialProviderTest.java
@@ -49,4 +49,13 @@ public class EnvSSLCredentialProviderTest {
     }
   }
 
+  @Test
+  public void testGetCredentialsWithEnvVars() throws Exception {
+    EnvSSLCredentialProvider sut = new EnvSSLCredentialProvider();
+    // assuming not to fail
+    sut.getCredential(SSLCredentialProvider.CredentialType.SSL_KEY_STORE_PASSWORD);
+    sut.getCredential(SSLCredentialProvider.CredentialType.SSL_CLIENT_KEY_STORE_PASSWORD);
+    sut.getCredential(SSLCredentialProvider.CredentialType.SSL_TRUST_STORE_PASSWORD);
+    sut.getCredential(SSLCredentialProvider.CredentialType.SSL_CLIENT_TRUST_STORE_PASSWORD);
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/93882086/solr/core/src/test/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProviderTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProviderTest.java
b/solr/core/src/test/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProviderTest.java
index e278cb5..4a5894d 100644
--- a/solr/core/src/test/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProviderTest.java
+++ b/solr/core/src/test/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProviderTest.java
@@ -52,4 +52,15 @@ public class SysPropSSLCredentialProviderTest {
       assertThat(sut.getCredential(set.getKey()), is(pw));
     }
   }
+
+
+  @Test
+  public void testGetCredentialsWithoutSetup() throws Exception {
+    SysPropSSLCredentialProvider sut = new SysPropSSLCredentialProvider();
+    // assuming not to fail
+    sut.getCredential(SSLCredentialProvider.CredentialType.SSL_KEY_STORE_PASSWORD);
+    sut.getCredential(SSLCredentialProvider.CredentialType.SSL_CLIENT_KEY_STORE_PASSWORD);
+    sut.getCredential(SSLCredentialProvider.CredentialType.SSL_TRUST_STORE_PASSWORD);
+    sut.getCredential(SSLCredentialProvider.CredentialType.SSL_CLIENT_TRUST_STORE_PASSWORD);
+  }
 }


Mime
View raw message