From bd2276260ea0b1ef7a6c0b227f8be098b6bfb50b Mon Sep 17 00:00:00 2001 From: Joseph Witt Date: Thu, 14 Sep 2023 15:37:42 -0500 Subject: [PATCH] NIFI-12051 Upgraded Groovy from 3.0.19 to 4.0.15 - Adjusted Groovy Maven coordinates to org.apache.groovy - Adjusted build configuration and tests for Groovy 4 This closes #7692 Signed-off-by: David Handermann --- .../nifi-flowfile-repo-serialization/pom.xml | 2 +- .../processors/graph/ExecuteGraphQueryIT.java | 65 ------------------- .../graph/ExecuteGraphQueryRecordTest.java | 33 ---------- .../test/resources/testComplexFlowFile.json | 9 --- .../nifi-graph-test-clients/pom.xml | 5 -- .../nifi-other-graph-services/pom.xml | 20 ------ nifi-nar-bundles/nifi-graph-bundle/pom.xml | 24 ------- .../nifi-groovyx-nar/pom.xml | 10 +-- .../nifi-groovyx-processors/pom.xml | 6 +- nifi-nar-bundles/nifi-groovyx-bundle/pom.xml | 9 +-- .../nifi-hive-test-utils/pom.xml | 4 +- .../nifi-hive3-processors/pom.xml | 10 ++- .../nifi-iceberg-processors/pom.xml | 2 +- .../nifi-mongodb-processors/pom.xml | 8 --- .../nifi-scripting-nar/pom.xml | 10 +-- .../nifi-scripting-processors/pom.xml | 16 ++--- .../groovy/test_record_reader_xml.groovy | 2 +- .../nifi-scripting-bundle/pom.xml | 8 +-- .../nifi-standard-processors/pom.xml | 12 ---- .../standard/TestEncryptContent.java | 17 ----- .../nifi-toolkit-encrypt-config/pom.xml | 11 ++-- ...NiFiRegistryAuthorizersXmlEncryptor.groovy | 2 +- ...gistryIdentityProvidersXmlEncryptor.groovy | 2 +- .../ConfigEncryptionToolTest.groovy | 28 ++++---- nifi-toolkit/pom.xml | 14 +--- pom.xml | 21 +++--- 26 files changed, 64 insertions(+), 286 deletions(-) delete mode 100644 nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/java/org/apache/nifi/processors/graph/ExecuteGraphQueryIT.java delete mode 100644 nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/resources/testComplexFlowFile.json diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-flowfile-repo-serialization/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-flowfile-repo-serialization/pom.xml index 9c1496f2b4..3f7e8450b4 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-flowfile-repo-serialization/pom.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-flowfile-repo-serialization/pom.xml @@ -71,7 +71,7 @@ test - org.codehaus.groovy + org.apache.groovy groovy-dateutil ${nifi.groovy.version} test diff --git a/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/java/org/apache/nifi/processors/graph/ExecuteGraphQueryIT.java b/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/java/org/apache/nifi/processors/graph/ExecuteGraphQueryIT.java deleted file mode 100644 index 2557cca0ee..0000000000 --- a/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/java/org/apache/nifi/processors/graph/ExecuteGraphQueryIT.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.nifi.processors.graph; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.nifi.graph.InMemoryJanusGraphClientService; -import org.apache.nifi.util.MockFlowFile; -import org.apache.nifi.util.TestRunner; -import org.apache.nifi.util.TestRunners; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class ExecuteGraphQueryIT { - TestRunner runner; - public static final String QUERY = "0.upto(9) {\n" + - "g.addV(\"test\").property(\"uuid\", UUID.randomUUID().toString()).next()\n" + - "}\n" + - "g.V().hasLabel(\"test\").count().next()"; - - @BeforeEach - public void setUp() throws Exception { - InMemoryJanusGraphClientService service = new InMemoryJanusGraphClientService(); - runner = TestRunners.newTestRunner(ExecuteGraphQuery.class); - runner.addControllerService("clientService", service); - runner.enableControllerService(service); - runner.setProperty(AbstractGraphExecutor.CLIENT_SERVICE, "clientService"); - runner.setProperty(AbstractGraphExecutor.QUERY, QUERY); - } - - @Test - public void test() throws Exception { - runner.run(); - runner.assertTransferCount(ExecuteGraphQuery.REL_FAILURE, 0); - runner.assertTransferCount(ExecuteGraphQuery.REL_ORIGINAL, 0); - runner.assertTransferCount(ExecuteGraphQuery.REL_SUCCESS, 1); - - List flowFileList = runner.getFlowFilesForRelationship(ExecuteGraphQuery.REL_SUCCESS); - MockFlowFile ff = flowFileList.get(0); - byte[] raw = runner.getContentAsByteArray(ff); - String str = new String(raw); - List> result = new ObjectMapper().readValue(str, List.class); - assertEquals(1, result.size()); - assertEquals(10, result.get(0).get("result")); - } -} diff --git a/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/java/org/apache/nifi/processors/graph/ExecuteGraphQueryRecordTest.java b/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/java/org/apache/nifi/processors/graph/ExecuteGraphQueryRecordTest.java index f8a99e3570..225a5d6e99 100644 --- a/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/java/org/apache/nifi/processors/graph/ExecuteGraphQueryRecordTest.java +++ b/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/java/org/apache/nifi/processors/graph/ExecuteGraphQueryRecordTest.java @@ -115,39 +115,6 @@ public class ExecuteGraphQueryRecordTest { assertTrue(contentEqualsWindowsSafe(relGraph, "/testFlowFileList.json")); } - @Test - public void testComplexFlowFile() throws Exception { - setupGraphClient(false); - List> test = new ArrayList<>(); - Map tempMap = new HashMap<>(); - tempMap.put("tMap", "123"); - tempMap.put("L", new ArrayList(){ - { - add(1); - add(2); - add(3); - } - }); - test.add(tempMap); - - byte[] json = JsonOutput.toJson(test).getBytes(); - String submissionScript = "Map vertexHashes = new HashMap()\n" + - "vertexHashes.put('1234', tMap)\n" + - "[ 'L': L, 'result': vertexHashes ]"; - runner.setProperty(ExecuteGraphQueryRecord.SUBMISSION_SCRIPT, submissionScript); - runner.setProperty("tMap", "/tMap"); - runner.setProperty("L", "/L"); - runner.enqueue(json, enqueProperties); - - runner.run(); - runner.assertTransferCount(ExecuteGraphQueryRecord.GRAPH, 1); - runner.assertTransferCount(ExecuteGraphQueryRecord.SUCCESS, 1); - runner.assertTransferCount(ExecuteGraphQueryRecord.FAILURE, 0); - MockFlowFile relGraph = runner.getFlowFilesForRelationship(ExecuteGraphQueryRecord.GRAPH).get(0); - - assertTrue(contentEqualsWindowsSafe(relGraph, "/testComplexFlowFile.json")); - } - @Test public void testAttributes() throws Exception { setupGraphClient(false); diff --git a/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/resources/testComplexFlowFile.json b/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/resources/testComplexFlowFile.json deleted file mode 100644 index 19852fdf06..0000000000 --- a/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/test/resources/testComplexFlowFile.json +++ /dev/null @@ -1,9 +0,0 @@ -[ { - "L" : [ 1, 2, 3 ] -}, { - "result" : { - "1234" : { - "1234" : "123" - } - } -} ] \ No newline at end of file diff --git a/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-test-clients/pom.xml b/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-test-clients/pom.xml index e1c7cfa73c..3695e7e48d 100644 --- a/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-test-clients/pom.xml +++ b/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-test-clients/pom.xml @@ -48,11 +48,6 @@ gremlin-driver ${gremlin.version} - - org.apache.tinkerpop - gremlin-groovy - ${gremlin.version} - com.google.guava diff --git a/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/pom.xml b/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/pom.xml index d2d9c07c41..005b9b8919 100644 --- a/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/pom.xml +++ b/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/pom.xml @@ -74,26 +74,6 @@ 2.0.0-SNAPSHOT compile - - org.codehaus.groovy - groovy - indy - - - org.codehaus.groovy - groovy-json - indy - - - org.codehaus.groovy - groovy-groovysh - indy - - - org.codehaus.groovy - groovy-jsr223 - indy - org.apache.tinkerpop gremlin-core diff --git a/nifi-nar-bundles/nifi-graph-bundle/pom.xml b/nifi-nar-bundles/nifi-graph-bundle/pom.xml index e1198bd3b7..24de5c0df2 100644 --- a/nifi-nar-bundles/nifi-graph-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-graph-bundle/pom.xml @@ -44,30 +44,6 @@ nifi-graph-processors 2.0.0-SNAPSHOT - - org.codehaus.groovy - groovy - ${nifi.groovy.version} - indy - - - org.codehaus.groovy - groovy-json - ${nifi.groovy.version} - indy - - - org.codehaus.groovy - groovy-groovysh - ${nifi.groovy.version} - indy - - - org.codehaus.groovy - groovy-jsr223 - ${nifi.groovy.version} - indy - diff --git a/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/pom.xml b/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/pom.xml index cb1ad1b40d..daaddd896f 100644 --- a/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/pom.xml +++ b/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-nar/pom.xml @@ -44,23 +44,19 @@ - org.codehaus.groovy + org.apache.groovy groovy-all pom runtime - org.codehaus.groovy + org.apache.groovy groovy-test - org.codehaus.groovy + org.apache.groovy groovy-test-junit5 - - org.codehaus.groovy - groovy-testng - org.apache.ant ant-junit diff --git a/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/pom.xml b/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/pom.xml index 603aa07a89..b7bc6699f3 100644 --- a/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/pom.xml +++ b/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/pom.xml @@ -42,20 +42,20 @@ 2.0.0-SNAPSHOT - org.codehaus.groovy + org.apache.groovy groovy-json ${nifi.groovy.version} provided - org.codehaus.groovy + org.apache.groovy groovy-sql ${nifi.groovy.version} provided - org.codehaus.groovy + org.apache.groovy groovy-dateutil ${nifi.groovy.version} diff --git a/nifi-nar-bundles/nifi-groovyx-bundle/pom.xml b/nifi-nar-bundles/nifi-groovyx-bundle/pom.xml index 135ce7e8a6..eb2b6da8b3 100644 --- a/nifi-nar-bundles/nifi-groovyx-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-groovyx-bundle/pom.xml @@ -29,11 +29,6 @@ nifi-groovyx-processors nifi-groovyx-nar - - - ${nifi.groovy.version} - - @@ -42,9 +37,9 @@ 2.0.0-SNAPSHOT - org.codehaus.groovy + org.apache.groovy groovy-all - ${groovyx.groovy.version} + ${nifi.groovy.version} pom provided diff --git a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-test-utils/pom.xml b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-test-utils/pom.xml index 42d07d48db..a3d7014abc 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-test-utils/pom.xml +++ b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-test-utils/pom.xml @@ -172,7 +172,7 @@ guava - org.codehaus.groovy + org.apache.groovy groovy-all @@ -217,7 +217,7 @@ woodstox-core - org.codehaus.groovy + org.apache.groovy groovy-all diff --git a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml index 822fafa035..1618c97ca3 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml +++ b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml @@ -180,6 +180,10 @@ org.apache.ivy ivy + + org.codehaus.groovy + groovy-all + @@ -330,12 +334,6 @@ curator-recipes ${curator.version} - - - org.codehaus.groovy - groovy-all - 2.4.21 - org.codehaus.jettison diff --git a/nifi-nar-bundles/nifi-iceberg-bundle/nifi-iceberg-processors/pom.xml b/nifi-nar-bundles/nifi-iceberg-bundle/nifi-iceberg-processors/pom.xml index c5c1d57ab3..522d9f1b79 100644 --- a/nifi-nar-bundles/nifi-iceberg-bundle/nifi-iceberg-processors/pom.xml +++ b/nifi-nar-bundles/nifi-iceberg-bundle/nifi-iceberg-processors/pom.xml @@ -132,7 +132,7 @@ bcprov-jdk15on - org.codehaus.groovy + org.apache.groovy groovy-all diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml index 2fc1ace584..460d4ba013 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml @@ -107,18 +107,10 @@ 2.0.0-SNAPSHOT test - - org.codehaus.groovy - groovy-json - ${nifi.groovy.version} - test - - org.testcontainers junit-jupiter - org.testcontainers mongodb diff --git a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-nar/pom.xml b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-nar/pom.xml index 6716a14a7a..3ba4c6e0ab 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-nar/pom.xml +++ b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-nar/pom.xml @@ -60,23 +60,19 @@ - org.codehaus.groovy + org.apache.groovy groovy-all pom runtime - org.codehaus.groovy + org.apache.groovy groovy-test - org.codehaus.groovy + org.apache.groovy groovy-test-junit5 - - org.codehaus.groovy - groovy-testng - org.apache.ant ant-junit diff --git a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/pom.xml b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/pom.xml index 1bc34d00e5..760f1d4a91 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/pom.xml +++ b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/pom.xml @@ -120,28 +120,28 @@ test - org.codehaus.groovy + org.apache.groovy groovy-json - ${scripting.groovy.version} + ${nifi.groovy.version} provided - org.codehaus.groovy + org.apache.groovy groovy-jsr223 - ${scripting.groovy.version} + ${nifi.groovy.version} provided - org.codehaus.groovy + org.apache.groovy groovy-xml - ${scripting.groovy.version} + ${nifi.groovy.version} provided - org.codehaus.groovy + org.apache.groovy groovy-dateutil - ${scripting.groovy.version} + ${nifi.groovy.version} diff --git a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/test_record_reader_xml.groovy b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/test_record_reader_xml.groovy index db2c03b079..f5e9cbb82f 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/test_record_reader_xml.groovy +++ b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/test_record_reader_xml.groovy @@ -38,7 +38,7 @@ class GroovyXmlRecordReader implements RecordReader { GroovyXmlRecordReader(final String recordTag, final RecordSchema schema, final InputStream inputStream) { recordSchema = schema - def xml = new XmlSlurper().parse(inputStream) + def xml = new groovy.xml.XmlSlurper().parse(inputStream) // Change the XML fields to a MapRecord for each incoming record recordIterator = xml[recordTag].collect {r -> // Create a map of field names to values, using the field names from the schema as keys into the XML object diff --git a/nifi-nar-bundles/nifi-scripting-bundle/pom.xml b/nifi-nar-bundles/nifi-scripting-bundle/pom.xml index 3db3997af0..95f7109a69 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-scripting-bundle/pom.xml @@ -30,10 +30,6 @@ nifi-scripting-nar - - 3.0.19 - - @@ -78,9 +74,9 @@ provided - org.codehaus.groovy + org.apache.groovy groovy-all - ${scripting.groovy.version} + ${nifi.groovy.version} pom provided diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml index 61be7c0c57..51857ddcc9 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml @@ -478,18 +478,6 @@ 2.0.0-SNAPSHOT test - - org.codehaus.groovy - groovy-json - ${nifi.groovy.version} - test - - - org.codehaus.groovy - groovy-servlet - ${nifi.groovy.version} - test - org.hamcrest hamcrest-all diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestEncryptContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestEncryptContent.java index 6ec4cda785..b5620cf286 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestEncryptContent.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestEncryptContent.java @@ -16,8 +16,6 @@ */ package org.apache.nifi.processors.standard; -import groovy.time.TimeCategory; -import groovy.time.TimeDuration; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Hex; import org.apache.nifi.components.ValidationResult; @@ -47,10 +45,8 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Paths; import java.security.Security; import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Collection; -import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -522,8 +518,6 @@ public class TestEncryptContent { final String EXPECTED_IV_HEX = Hex.encodeHexString(Arrays.copyOfRange(flowfileContentBytes, ivDelimiterStart - 16, ivDelimiterStart)); // Assert the timestamp attribute was written and is accurate - final TimeDuration diff = calculateTimestampDifference(new Date(), flowFile.getAttribute("encryptcontent.timestamp")); - assertTrue(diff.toMilliseconds() < 1_000); assertEquals(encryptionMethod.name(), flowFile.getAttribute("encryptcontent.algorithm")); assertEquals(kdf.name(), flowFile.getAttribute("encryptcontent.kdf")); assertEquals("encrypted", flowFile.getAttribute("encryptcontent.action")); @@ -566,11 +560,6 @@ public class TestEncryptContent { int ivDelimiterStart = CipherUtility.findSequence(flowfileContentBytes, RandomIVPBECipherProvider.IV_DELIMITER); assertEquals(16, ivDelimiterStart); - final TimeDuration diff = calculateTimestampDifference(new Date(), flowFile.getAttribute("encryptcontent.timestamp")); - - // Assert the timestamp attribute was written and is accurate - assertTrue(diff.toMilliseconds() < 1_000); - final String EXPECTED_IV_HEX = Hex.encodeHexString(Arrays.copyOfRange(flowfileContentBytes, 0, ivDelimiterStart)); final int EXPECTED_CIPHER_TEXT_LENGTH = CipherUtility.calculateCipherTextLength(PLAINTEXT.length(), 0); assertEquals(encryptionMethod.name(), flowFile.getAttribute("encryptcontent.algorithm")); @@ -771,10 +760,4 @@ public class TestEncryptContent { return Hex.encodeHexString(rawSaltBytes); } - private static TimeDuration calculateTimestampDifference(Date date, String timestamp) throws ParseException { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS Z"); - Date parsedTimestamp = formatter.parse(timestamp); - - return TimeCategory.minus(date, parsedTimestamp); - } } diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/pom.xml b/nifi-toolkit/nifi-toolkit-encrypt-config/pom.xml index 3518eac80b..e150bb5ca4 100644 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/pom.xml +++ b/nifi-toolkit/nifi-toolkit-encrypt-config/pom.xml @@ -139,26 +139,27 @@ test - org.codehaus.groovy + org.apache.groovy groovy-test - org.codehaus.groovy + org.apache.groovy groovy-all + ${nifi.groovy.version} pom - org.codehaus.groovy + org.apache.groovy groovy-groovysh - org.codehaus.groovy + org.apache.groovy groovy-ant - org.codehaus.groovy + org.apache.groovy groovy-cli-commons ${nifi.groovy.version} diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/util/NiFiRegistryAuthorizersXmlEncryptor.groovy b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/util/NiFiRegistryAuthorizersXmlEncryptor.groovy index b474e4e236..b07f7b23f0 100644 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/util/NiFiRegistryAuthorizersXmlEncryptor.groovy +++ b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/util/NiFiRegistryAuthorizersXmlEncryptor.groovy @@ -85,7 +85,7 @@ class NiFiRegistryAuthorizersXmlEncryptor extends XmlEncryptor { // Find & replace the userGroupProvider element of the updated content in the original contents try { - def parsedXml = new XmlSlurper().parseText(updatedXmlContent) + def parsedXml = new groovy.xml.XmlSlurper().parseText(updatedXmlContent) def provider = parsedXml.userGroupProvider.find { it.'class' as String == LDAP_USER_GROUP_PROVIDER_CLASS } if (provider) { def serializedProvider = new XmlUtil().serialize(provider) diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/util/NiFiRegistryIdentityProvidersXmlEncryptor.groovy b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/util/NiFiRegistryIdentityProvidersXmlEncryptor.groovy index e37788c579..dab9bf9dd7 100644 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/util/NiFiRegistryIdentityProvidersXmlEncryptor.groovy +++ b/nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/toolkit/encryptconfig/util/NiFiRegistryIdentityProvidersXmlEncryptor.groovy @@ -84,7 +84,7 @@ class NiFiRegistryIdentityProvidersXmlEncryptor extends XmlEncryptor { // Find & replace the provider element of the updated content in the original contents try { - def parsedXml = new XmlSlurper().parseText(updatedXmlContent) + def parsedXml = new groovy.xml.XmlSlurper().parseText(updatedXmlContent) def provider = parsedXml.provider.find { it.'class' as String == LDAP_PROVIDER_CLASS } if (provider) { def serializedProvider = new XmlUtil().serialize(provider) diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/groovy/org/apache/nifi/properties/ConfigEncryptionToolTest.groovy b/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/groovy/org/apache/nifi/properties/ConfigEncryptionToolTest.groovy index 45a44bb201..8153517fc8 100644 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/groovy/org/apache/nifi/properties/ConfigEncryptionToolTest.groovy +++ b/nifi-toolkit/nifi-toolkit-encrypt-config/src/test/groovy/org/apache/nifi/properties/ConfigEncryptionToolTest.groovy @@ -2080,8 +2080,8 @@ class ConfigEncryptionToolTest { logger.info("Updated XML content: ${updatedXmlContent}") // Check that the output values for sensitive properties are not the same as the original (i.e. it was encrypted) - def originalParsedXml = new XmlSlurper().parseText(originalXmlContent) - def updatedParsedXml = new XmlSlurper().parseText(updatedXmlContent) + def originalParsedXml = new groovy.xml.XmlSlurper().parseText(originalXmlContent) + def updatedParsedXml = new groovy.xml.XmlSlurper().parseText(updatedXmlContent) assert originalParsedXml != updatedParsedXml assert originalParsedXml.'**'.findAll { it.@encryption } != updatedParsedXml.'**'.findAll { it.@encryption @@ -2164,8 +2164,8 @@ class ConfigEncryptionToolTest { logger.info("Updated XML content: ${updatedXmlContent}") // Check that the output values for sensitive properties are not the same as the original (i.e. it was encrypted) - def originalParsedXml = new XmlSlurper().parseText(originalXmlContent) - def updatedParsedXml = new XmlSlurper().parseText(updatedXmlContent) + def originalParsedXml = new groovy.xml.XmlSlurper().parseText(originalXmlContent) + def updatedParsedXml = new groovy.xml.XmlSlurper().parseText(updatedXmlContent) assert originalParsedXml != updatedParsedXml def encryptedValues = updatedParsedXml.provider.find { @@ -2908,8 +2908,8 @@ class ConfigEncryptionToolTest { logger.info("Updated XML content: ${updatedXmlContent}") // Check that the output values for sensitive properties are not the same as the original (i.e. it was encrypted) - def originalParsedXml = new XmlSlurper().parseText(originalXmlContent) - def updatedParsedXml = new XmlSlurper().parseText(updatedXmlContent) + def originalParsedXml = new groovy.xml.XmlSlurper().parseText(originalXmlContent) + def updatedParsedXml = new groovy.xml.XmlSlurper().parseText(updatedXmlContent) assert originalParsedXml != updatedParsedXml assert originalParsedXml.'**'.findAll { it.@encryption } != updatedParsedXml.'**'.findAll { it.@encryption @@ -2992,8 +2992,8 @@ class ConfigEncryptionToolTest { logger.info("Updated XML content: ${updatedXmlContent}") // Check that the output values for sensitive properties are not the same as the original (i.e. it was encrypted) - def originalParsedXml = new XmlSlurper().parseText(originalXmlContent) - def updatedParsedXml = new XmlSlurper().parseText(updatedXmlContent) + def originalParsedXml = new groovy.xml.XmlSlurper().parseText(originalXmlContent) + def updatedParsedXml = new groovy.xml.XmlSlurper().parseText(updatedXmlContent) assert originalParsedXml != updatedParsedXml def encryptedValues = updatedParsedXml.userGroupProvider.find { @@ -3070,8 +3070,8 @@ class ConfigEncryptionToolTest { logger.info("Updated XML content: ${updatedXmlContent}") // Check that the output values for sensitive properties are not the same as the original (i.e. it was encrypted) - def originalParsedXml = new XmlSlurper().parseText(originalXmlContent) - def updatedParsedXml = new XmlSlurper().parseText(updatedXmlContent) + def originalParsedXml = new groovy.xml.XmlSlurper().parseText(originalXmlContent) + def updatedParsedXml = new groovy.xml.XmlSlurper().parseText(updatedXmlContent) assert originalParsedXml != updatedParsedXml assert originalParsedXml.'**'.findAll { it.@encryption } != updatedParsedXml.'**'.findAll { it.@encryption @@ -3200,8 +3200,8 @@ class ConfigEncryptionToolTest { final String updatedLipXmlContent = outputLIPFile.text logger.info("Updated LIP XML content: ${updatedLipXmlContent}") // Check that the output values for sensitive properties are not the same as the original (i.e. it was encrypted) - def originalLipParsedXml = new XmlSlurper().parseText(originalLipXmlContent) - def updatedLipParsedXml = new XmlSlurper().parseText(updatedLipXmlContent) + def originalLipParsedXml = new groovy.xml.XmlSlurper().parseText(originalLipXmlContent) + def updatedLipParsedXml = new groovy.xml.XmlSlurper().parseText(updatedLipXmlContent) assert originalLipParsedXml != updatedLipParsedXml assert originalLipParsedXml.'**'.findAll { it.@encryption } != updatedLipParsedXml.'**'.findAll { it.@encryption @@ -3224,8 +3224,8 @@ class ConfigEncryptionToolTest { final String updatedAuthorizersXmlContent = outputAuthorizersFile.text logger.info("Updated Authorizers XML content: ${updatedAuthorizersXmlContent}") // Check that the output values for sensitive properties are not the same as the original (i.e. it was encrypted) - def originalAuthorizersParsedXml = new XmlSlurper().parseText(originalAuthorizersXmlContent) - def updatedAuthorizersParsedXml = new XmlSlurper().parseText(updatedAuthorizersXmlContent) + def originalAuthorizersParsedXml = new groovy.xml.XmlSlurper().parseText(originalAuthorizersXmlContent) + def updatedAuthorizersParsedXml = new groovy.xml.XmlSlurper().parseText(updatedAuthorizersXmlContent) assert originalAuthorizersParsedXml != updatedAuthorizersParsedXml assert originalAuthorizersParsedXml.'**'.findAll { it.@encryption diff --git a/nifi-toolkit/pom.xml b/nifi-toolkit/pom.xml index a4d4c9b3cc..825122b995 100644 --- a/nifi-toolkit/pom.xml +++ b/nifi-toolkit/pom.xml @@ -30,15 +30,11 @@ nifi-toolkit-cli nifi-toolkit-api - - 3.0.19 - - org.codehaus.groovy + org.apache.groovy groovy-all - ${toolkit.groovy.version} pom compile @@ -47,17 +43,13 @@ slf4j-log4j12 - org.codehaus.groovy + org.apache.groovy groovy-test - org.codehaus.groovy + org.apache.groovy groovy-test-junit5 - - org.codehaus.groovy - groovy-testng - org.apache.ant ant-junit diff --git a/pom.xml b/pom.xml index b9c3e96336..4a12c56456 100644 --- a/pom.xml +++ b/pom.xml @@ -130,9 +130,9 @@ 1.3.2 2.3.3 2.4.11 - 3.0.19 + 4.0.15 3.9.0 - 3.0.9-03 + 4.0.15-03 3.1.2 3.3.6 1.2.1 @@ -336,24 +336,20 @@ ${mockito.version} - org.codehaus.groovy + org.apache.groovy groovy-all ${nifi.groovy.version} pom test - org.codehaus.groovy + org.apache.groovy groovy-test - org.codehaus.groovy + org.apache.groovy groovy-test-junit5 - - org.codehaus.groovy - groovy-testng - org.apache.ant ant-junit @@ -361,7 +357,7 @@ - org.codehaus.groovy + org.apache.groovy groovy-test ${nifi.groovy.version} test @@ -933,8 +929,9 @@ - ${maven.compiler.source} - ${maven.compiler.target} + ${maven.compiler.release} + ${maven.compiler.release} + ${maven.compiler.release}