This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit 3feb85a030c6766941e64875ff825560878d54cc
Author: Andy LoPresto <[email protected]>
AuthorDate: Fri Mar 13 22:12:17 2020 -0700

    NIFI-7223 Resolved merge conflicts from additional test case for null key 
password.
    
    This closes #4145.
    
    Signed-off-by: Joe Witt <[email protected]>
---
 .../okhttp/OkHttpReplicationClientTest.groovy      | 24 ++++++++++++----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/groovy/org/apache/nifi/cluster/coordination/http/replication/okhttp/OkHttpReplicationClientTest.groovy
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/groovy/org/apache/nifi/cluster/coordination/http/replication/okhttp/OkHttpReplicationClientTest.groovy
index c30c3e9..6c1d23d 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/groovy/org/apache/nifi/cluster/coordination/http/replication/okhttp/OkHttpReplicationClientTest.groovy
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/groovy/org/apache/nifi/cluster/coordination/http/replication/okhttp/OkHttpReplicationClientTest.groovy
@@ -163,27 +163,29 @@ class OkHttpReplicationClientTest extends GroovyTestCase {
     }
 
     @Test
-    void testShouldUseKeystorePasswdIfKeyPasswdIsNull() {
+    void testShouldUseKeystorePasswordIfKeyPasswordIsNull() {
         // Arrange
         Map flowfileEncryptionProps = [
-                (NiFiProperties.SECURITY_TRUSTSTORE): 
"./src/test/resources/conf/truststore.jks",
-                (NiFiProperties.SECURITY_TRUSTSTORE_TYPE): "JKS",
+                (NiFiProperties.SECURITY_TRUSTSTORE)       : 
"./src/test/resources/conf/truststore.jks",
+                (NiFiProperties.SECURITY_TRUSTSTORE_TYPE)  : "JKS",
                 (NiFiProperties.SECURITY_TRUSTSTORE_PASSWD): 
"passwordpassword",
-                (NiFiProperties.SECURITY_KEYSTORE): 
"./src/test/resources/conf/keystore.jks",
-                (NiFiProperties.SECURITY_KEYSTORE_TYPE): "JKS",
-                (NiFiProperties.SECURITY_KEYSTORE_PASSWD): "passwordpassword",
-                (NiFiProperties.WEB_HTTPS_HOST): "localhost",
-                (NiFiProperties.WEB_HTTPS_PORT): "51552",
+                (NiFiProperties.SECURITY_KEYSTORE)         : 
"./src/test/resources/conf/keystore.jks",
+                (NiFiProperties.SECURITY_KEYSTORE_TYPE)    : "JKS",
+                (NiFiProperties.SECURITY_KEYSTORE_PASSWD)  : 
"passwordpassword",
+                (NiFiProperties.WEB_HTTPS_HOST)            : "localhost",
+                (NiFiProperties.WEB_HTTPS_PORT)            : "51552",
         ]
         NiFiProperties mockNiFiProperties = new StandardNiFiProperties(new 
Properties(flowfileEncryptionProps))
 
         // Act
         OkHttpReplicationClient client = new 
OkHttpReplicationClient(mockNiFiProperties)
+        logger.info("Created secure HTTPS client with TLS configured: 
${client.isTLSConfigured()}")
 
         // Assert
-        assertNotNull(client.okHttpClient.sslSocketFactory)
-        assertEquals(SunX509KeyManagerImpl.class, 
client.okHttpClient.sslSocketFactory.context.getX509KeyManager().getClass())
-        
assertNotNull(client.okHttpClient.sslSocketFactory.context.getX509KeyManager().credentialsMap["nifi-key"])
    }
+        assert client.isTLSConfigured()
+        assert client.okHttpClient.sslSocketFactory
+        assert 
client.okHttpClient.sslSocketFactory.context.getX509KeyManager().credentialsMap["nifi-key"]
+    }
 
     @Test
     void testShouldFailIfKeyPasswordIsSetButKeystorePasswordIsBlank() {

Reply via email to