mirror of https://github.com/apache/nifi.git
NIFI-7223 Resolved merge conflicts from additional test case for null key password.
This closes #4145. Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
parent
69b6c231fd
commit
3feb85a030
|
@ -163,27 +163,29 @@ class OkHttpReplicationClientTest extends GroovyTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testShouldUseKeystorePasswdIfKeyPasswdIsNull() {
|
void testShouldUseKeystorePasswordIfKeyPasswordIsNull() {
|
||||||
// Arrange
|
// Arrange
|
||||||
Map flowfileEncryptionProps = [
|
Map flowfileEncryptionProps = [
|
||||||
(NiFiProperties.SECURITY_TRUSTSTORE): "./src/test/resources/conf/truststore.jks",
|
(NiFiProperties.SECURITY_TRUSTSTORE) : "./src/test/resources/conf/truststore.jks",
|
||||||
(NiFiProperties.SECURITY_TRUSTSTORE_TYPE): "JKS",
|
(NiFiProperties.SECURITY_TRUSTSTORE_TYPE) : "JKS",
|
||||||
(NiFiProperties.SECURITY_TRUSTSTORE_PASSWD): "passwordpassword",
|
(NiFiProperties.SECURITY_TRUSTSTORE_PASSWD): "passwordpassword",
|
||||||
(NiFiProperties.SECURITY_KEYSTORE): "./src/test/resources/conf/keystore.jks",
|
(NiFiProperties.SECURITY_KEYSTORE) : "./src/test/resources/conf/keystore.jks",
|
||||||
(NiFiProperties.SECURITY_KEYSTORE_TYPE): "JKS",
|
(NiFiProperties.SECURITY_KEYSTORE_TYPE) : "JKS",
|
||||||
(NiFiProperties.SECURITY_KEYSTORE_PASSWD): "passwordpassword",
|
(NiFiProperties.SECURITY_KEYSTORE_PASSWD) : "passwordpassword",
|
||||||
(NiFiProperties.WEB_HTTPS_HOST): "localhost",
|
(NiFiProperties.WEB_HTTPS_HOST) : "localhost",
|
||||||
(NiFiProperties.WEB_HTTPS_PORT): "51552",
|
(NiFiProperties.WEB_HTTPS_PORT) : "51552",
|
||||||
]
|
]
|
||||||
NiFiProperties mockNiFiProperties = new StandardNiFiProperties(new Properties(flowfileEncryptionProps))
|
NiFiProperties mockNiFiProperties = new StandardNiFiProperties(new Properties(flowfileEncryptionProps))
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
OkHttpReplicationClient client = new OkHttpReplicationClient(mockNiFiProperties)
|
OkHttpReplicationClient client = new OkHttpReplicationClient(mockNiFiProperties)
|
||||||
|
logger.info("Created secure HTTPS client with TLS configured: ${client.isTLSConfigured()}")
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
assertNotNull(client.okHttpClient.sslSocketFactory)
|
assert client.isTLSConfigured()
|
||||||
assertEquals(SunX509KeyManagerImpl.class, client.okHttpClient.sslSocketFactory.context.getX509KeyManager().getClass())
|
assert client.okHttpClient.sslSocketFactory
|
||||||
assertNotNull(client.okHttpClient.sslSocketFactory.context.getX509KeyManager().credentialsMap["nifi-key"]) }
|
assert client.okHttpClient.sslSocketFactory.context.getX509KeyManager().credentialsMap["nifi-key"]
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testShouldFailIfKeyPasswordIsSetButKeystorePasswordIsBlank() {
|
void testShouldFailIfKeyPasswordIsSetButKeystorePasswordIsBlank() {
|
||||||
|
|
Loading…
Reference in New Issue