[
https://issues.apache.org/jira/browse/NIFI-7048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Handermann resolved NIFI-7048.
------------------------------------
Fix Version/s: 1.12.0
Resolution: Fixed
[GitHub PR 4263|https://github.com/apache/nifi/pull/4263] removed
SSLContextFactory and SSLContextFactoryTest in nifi-socket-utils, eliminating
the unit test dependency on JAVA_HOME.
> Unit tests should not fail if JAVA_HOME set incorrectly
> -------------------------------------------------------
>
> Key: NIFI-7048
> URL: https://issues.apache.org/jira/browse/NIFI-7048
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Tools and Build
> Affects Versions: 1.10.0
> Reporter: Andy LoPresto
> Assignee: Andy LoPresto
> Priority: Major
> Labels: jdk, jre, security, tests, truststore
> Fix For: 1.12.0
>
>
> A number of users have had difficulty recently where
> {{SSLContextFactoryTest}} will fail due to an issue locating the JDK default
> {{cacerts}} truststore. This is usually caused by {{JAVA_HOME}} being
> improperly set. However, this issue was not present before the effort to
> support Java 11. During that time, the directory structure for Java <=8 and
> Java >=9 has changed, so there is logic to attempt to detect the version and
> build the correct path.
> Two improvements should be made:
> 1. The tests should include an {{Assume}} statement to skip execution if
> {{cacerts}} cannot be located
> 1. A clear error message (including the current value of {{JAVA_HOME}})
> should be printed explaining the issue and providing instructions on how to
> resolve it
> Example failing output:
> {code}
> Some notes - I did run into a test failure (that I didn't have before) but
> it was because JAVA_HOME was not set properly. I copy the error in case it
> happens to someone else. This is on recently added tests:
> [ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed:
> 0.666 s <<< FAILURE! - in org.apache.nifi.io.socket.SSLContextFactoryTest
> [ERROR]
> testShouldVerifyKeystoreWithEmptyKeyPassword(org.apache.nifi.io.socket.SSLContextFactoryTest)
> Time elapsed: 0.051 s <<< ERROR!
> java.io.FileNotFoundException: null/jre/lib/security/cacerts (No such file
> or directory)
> at
> org.apache.nifi.io.socket.SSLContextFactoryTest.testShouldVerifyKeystoreWithEmptyKeyPassword(SSLContextFactoryTest.groovy:162)
> [ERROR]
> testShouldVerifyKeystoreWithDifferentKeyPassword(org.apache.nifi.io.socket.SSLContextFactoryTest)
> Time elapsed: 0.002 s <<< ERROR!
> java.io.FileNotFoundException: null/jre/lib/security/cacerts (No such file
> or directory)
> at
> org.apache.nifi.io.socket.SSLContextFactoryTest.testShouldVerifyKeystoreWithDifferentKeyPassword(SSLContextFactoryTest.groovy:138)
> [ERROR]
> testShouldVerifyKeystoreWithSameKeyPassword(org.apache.nifi.io.socket.SSLContextFactoryTest)
> Time elapsed: 0.001 s <<< ERROR!
> java.io.FileNotFoundException: null/jre/lib/security/cacerts (No such file
> or directory)
> at
> org.apache.nifi.io.socket.SSLContextFactoryTest.testShouldVerifyKeystoreWithSameKeyPassword(SSLContextFactoryTest.groovy:113)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)