mirror of https://github.com/apache/lucene.git
SOLR-10783: Fix constructor.
This commit is contained in:
parent
f828edf332
commit
9388208613
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue