NIFI-5574 Removed usage of Paths.get() due to TEST_RES_PATH being resolved to a string from a URI, which results in platform-specific path information (C:\) when tests are run on Windows.

This closes #2988

Signed-off-by: Mike Thomsen <mikerthomsen@gmail.com>
This commit is contained in:
Jeff Storck 2018-09-04 17:36:20 -04:00 committed by Mike Thomsen
parent ba642485cc
commit 376c344edb

View File

@ -138,7 +138,7 @@ class NiFiGroovyTest extends GroovyTestCase {
@Test
void testMainShouldHandleMalformedBootstrapKeyFromFile() throws Exception {
// Arrange
def passwordFile = Paths.get(TEST_RES_PATH, "NiFiProperties", "password-testMainShouldHandleMalformedBootstrapKeyFromFile.txt").toFile()
def passwordFile = new File("${TEST_RES_PATH}/NiFiProperties/password-testMainShouldHandleMalformedBootstrapKeyFromFile.txt")
passwordFile.text = "BAD KEY"
def args = ["-K", passwordFile.absolutePath] as String[]
@ -158,7 +158,7 @@ class NiFiGroovyTest extends GroovyTestCase {
// 64 chars of '0' for a 256 bit key; 32 chars for 128 bit
final String DIFFERENT_KEY = "0" * (currentMaxKeyLengthInBits / 4)
def passwordFile = Paths.get(TEST_RES_PATH, "NiFiProperties", "password-testInitializePropertiesShouldSetBootstrapKeyFromFile.txt").toFile()
def passwordFile = new File("${TEST_RES_PATH}/NiFiProperties/password-testInitializePropertiesShouldSetBootstrapKeyFromFile.txt")
passwordFile.text = DIFFERENT_KEY
def args = ["-K", passwordFile.absolutePath] as String[]