exceptionfactory commented on a change in pull request #4715:
URL: https://github.com/apache/nifi/pull/4715#discussion_r538821132
##########
File path:
nifi-toolkit/nifi-toolkit-encrypt-config/src/test/groovy/org/apache/nifi/properties/ConfigEncryptionToolTest.groovy
##########
@@ -4053,18 +4062,158 @@ class ConfigEncryptionToolTest extends GroovyTestCase {
def verifyTool = new ConfigEncryptionTool()
verifyTool.isVerbose = true
verifyTool.flowXmlPath = workingFlowXmlFile.path
- String updatedFlowXmlContent = verifyTool.loadFlowXml()
+ InputStream updatedFlowXmlContent =
verifyTool.loadFlowXml(workingFlowXmlFile.path)
- // Check that the flow.xml.gz content changed
- assert updatedFlowXmlContent != ORIGINAL_FLOW_XML_CONTENT
+ def migratedFlowCipherTexts =
findFieldsInStream(updatedFlowXmlContent, WFXCTR)
// Verify that the cipher texts decrypt correctly
logger.info("Original flow.xml.gz cipher texts:
${originalFlowCipherTexts}")
- def flowCipherTexts = updatedFlowXmlContent.findAll(WFXCTR)
- logger.info("Updated flow.xml.gz cipher texts:
${flowCipherTexts}")
- assert flowCipherTexts.size() == CIPHER_TEXT_COUNT
- flowCipherTexts.every {
- assert ConfigEncryptionTool.decryptFlowElement(it,
newFlowPassword) == "thisIsABadPassword"
+ logger.info("Updated flow.xml.gz cipher texts:
${migratedFlowCipherTexts}")
+ assert migratedFlowCipherTexts.size() == CIPHER_TEXT_COUNT
+ migratedFlowCipherTexts.each {
+ String decryptedValue =
ConfigEncryptionTool.decryptFlowElement(it, newFlowPassword)
+ logger.info("Decrypted value of migrated
${workingFlowXmlFile.path} was: ${decryptedValue}")
+ assert decryptedValue == PASSWORD || decryptedValue ==
ANOTHER_PASSWORD
+ }
+ }
+ })
+
+ // Act
+ ConfigEncryptionTool.main(args)
+ logger.info("Invoked #main with ${args.join(" ")}")
+
+ // Assert
+
+ // Assertions defined above
Review comment:
It looks like this comment and the one above should be removed.
##########
File path:
nifi-toolkit/nifi-toolkit-encrypt-config/src/test/groovy/org/apache/nifi/properties/ConfigEncryptionToolTest.groovy
##########
@@ -287,7 +291,10 @@ class ConfigEncryptionToolTest extends GroovyTestCase {
// Assert
assert !TestAppender.events.isEmpty()
- assert TestAppender.events.first().message =~ "The source
nifi.properties and destination nifi.properties are identical \\[.*\\] so the
original will be overwritten"
+ assert TestAppender.events.stream().any() {
+ it.message =~ "The source nifi.properties and destination
nifi.properties are identical \\[.*\\] so the original will be overwritten"
+ }
+ //assert TestAppender.events.first().message =~ "The source
nifi.properties and destination nifi.properties are identical \\[.*\\] so the
original will be overwritten"
Review comment:
It looks like this commented line should be removed.
##########
File path:
nifi-toolkit/nifi-toolkit-encrypt-config/src/main/groovy/org/apache/nifi/properties/ConfigEncryptionTool.groovy
##########
@@ -64,8 +68,8 @@ class ConfigEncryptionTool {
public String outputLoginIdentityProvidersPath
public String authorizersPath
public String outputAuthorizersPath
- public String flowXmlPath
- public String outputFlowXmlPath
+ public static flowXmlPath
+ public static outputFlowXmlPath
Review comment:
Is there a reason these values are static?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]