mirror of https://github.com/apache/nifi.git
NIFI-2618 Reverted merging PR 955 to master as 1.0.0 requires Java 8.
This commit is contained in:
parent
d600b065bb
commit
8556777bf6
|
@ -261,28 +261,12 @@ class TestPostHTTPGroovy extends GroovyTestCase {
|
|||
assert response == MSG.reverse()
|
||||
}
|
||||
|
||||
/**
|
||||
* This test asserts the default TLS version is TLSv1.2, but this only accurate for Java 8 and above. For Java 7, the default is TLSv1.
|
||||
*/
|
||||
@Test
|
||||
public void testDefaultShouldPreferTLSv1_2() {
|
||||
// Arrange
|
||||
final String MSG = "This is a test message"
|
||||
final String url = "${HTTPS_URL}/ReverseHandler.groovy?string=${URLEncoder.encode(MSG, "UTF-8")}"
|
||||
|
||||
// Determine expected default TLS version based on Java version
|
||||
logger.info("System Java Version: ${System.getProperty("java.version")}")
|
||||
logger.info("Implementation version: ${Runtime.getPackage().getImplementationVersion()}")
|
||||
logger.info("Specification version: ${Runtime.getPackage().getSpecificationVersion()}")
|
||||
String EXPECTED_TLS_VERSION
|
||||
if ((Runtime.getPackage().getSpecificationVersion() as double) > 1.7) {
|
||||
logger.info("Java 8 or above; default TLS version is TLSv1.2")
|
||||
EXPECTED_TLS_VERSION = TLSv1_2
|
||||
} else {
|
||||
logger.info("Java 7 or below; default TLS version is TLSv1")
|
||||
EXPECTED_TLS_VERSION = TLSv1
|
||||
}
|
||||
|
||||
// Configure server with all TLS protocols
|
||||
server = createServer()
|
||||
|
||||
|
@ -304,7 +288,7 @@ class TestPostHTTPGroovy extends GroovyTestCase {
|
|||
logger.info("Selected protocol: ${selectedProtocol}")
|
||||
|
||||
// Assert
|
||||
assert selectedProtocol == EXPECTED_TLS_VERSION
|
||||
assert selectedProtocol == TLSv1_2
|
||||
}
|
||||
|
||||
private static void enableContextServiceProtocol(TestRunner runner, String protocol) {
|
||||
|
|
Loading…
Reference in New Issue