ChrisSamo632 commented on a change in pull request #4854:
URL: https://github.com/apache/nifi/pull/4854#discussion_r587190883



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/src/test/groovy/org/apache/nifi/properties/NiFiPropertiesLoaderGroovyTest.groovy
##########
@@ -472,4 +472,21 @@ class NiFiPropertiesLoaderGroovyTest extends 
GroovyTestCase {
 
         assert readPropertiesAndValues == readPasswordPropertiesAndValues
     }
+    
+    @Test
+    void testShouldStripWhitespace() throws Exception {
+        // Arrange
+        File unprotectedFile = new 
File("src/test/resources/conf/nifi_with_whitespace.properties")
+        NiFiPropertiesLoader niFiPropertiesLoader = new NiFiPropertiesLoader()
+
+        // Act
+        NiFiProperties niFiProperties = 
niFiPropertiesLoader.load(unprotectedFile.path)
+
+        // Assert
+        assert 
niFiProperties.getProperty("nifi.whitespace.propWithLeadingSpace") == "foo";
+        assert 
niFiProperties.getProperty("nifi.whitespace.propWithTrailingSpace") == "foo";
+        assert 
niFiProperties.getProperty("nifi.whitespace.propWithLeadingAndTrailingSpace") 
== "foo";
+        assert 
niFiProperties.getProperty("nifi.whitespace.propWithTrailingTab") == "foo";

Review comment:
       Looks like this test is failing in all the checks, looking at your 
regex, not sure you're currently removing tab characters




----------------------------------------------------------------
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]


Reply via email to