NIFI-2618 Reverted merging PR 955 to master as 1.0.0 requires Java 8.

This commit is contained in:
Andy LoPresto 2016-08-30 09:27:14 -07:00
parent d600b065bb
commit 8556777bf6
No known key found for this signature in database
GPG Key ID: 3C6EF65B2F7DEF69
1 changed files with 1 additions and 17 deletions

View File

@ -261,28 +261,12 @@ class TestPostHTTPGroovy extends GroovyTestCase {
assert response == MSG.reverse() 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 @Test
public void testDefaultShouldPreferTLSv1_2() { public void testDefaultShouldPreferTLSv1_2() {
// Arrange // Arrange
final String MSG = "This is a test message" final String MSG = "This is a test message"
final String url = "${HTTPS_URL}/ReverseHandler.groovy?string=${URLEncoder.encode(MSG, "UTF-8")}" 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 // Configure server with all TLS protocols
server = createServer() server = createServer()
@ -304,7 +288,7 @@ class TestPostHTTPGroovy extends GroovyTestCase {
logger.info("Selected protocol: ${selectedProtocol}") logger.info("Selected protocol: ${selectedProtocol}")
// Assert // Assert
assert selectedProtocol == EXPECTED_TLS_VERSION assert selectedProtocol == TLSv1_2
} }
private static void enableContextServiceProtocol(TestRunner runner, String protocol) { private static void enableContextServiceProtocol(TestRunner runner, String protocol) {