kevdoran commented on code in PR #11789:
URL: https://github.com/apache/nifi/pull/11789#discussion_r4224672796


##########
nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/connectors/ConnectorUndeclaredExternalPropertyIT.java:
##########
@@ -78,37 +82,54 @@ protected boolean isAllowFactoryReuse() {
     }
 
     @Test
-    public void testSaveDropsUndeclaredExternalProperty() throws 
NiFiClientException, IOException {
+    public void 
testReadMigratesInMemoryAndExplicitSavePersistsMigratedConfiguration() throws 
NiFiClientException, IOException {
         final JsonNode initialConfiguration = 
readConfiguration("initial-config.json");
-        assertEquals(DECLARED_PROPERTY_VALUE, 
propertyValue(initialConfiguration, DECLARED_PROPERTY_NAME));
+        assertEquals(DECLARED_PROPERTY_VALUE, 
propertyValue(initialConfiguration, LEGACY_PROPERTY_NAME));
+        assertFalse(containsProperty(initialConfiguration, 
DECLARED_PROPERTY_NAME));
         assertEquals("should-be-dropped", propertyValue(initialConfiguration, 
UNDECLARED_PROPERTY_NAME));
 
         final ConnectorEntity connector = 
getClientUtil().createConnector("NopConnector");
         assertNotNull(connector);
 
         final ConnectorEntity beforeSave = 
getNifiClient().getConnectorClient().getConnector(connector.getId());
-        assertEquals(DECLARED_PROPERTY_VALUE, 
ignoredPropertyValue(beforeSave));
+        assertEquals(DECLARED_PROPERTY_VALUE, workingPropertyValue(beforeSave, 
DECLARED_PROPERTY_NAME));
+        assertEquals(REQUIRED_DEFAULT_PROPERTY_VALUE, 
workingPropertyValue(beforeSave, REQUIRED_DEFAULT_PROPERTY_NAME));
+        final ConnectorEntity repeatedRead = 
getNifiClient().getConnectorClient().getConnector(connector.getId());
+        assertEquals(DECLARED_PROPERTY_VALUE, 
workingPropertyValue(repeatedRead, DECLARED_PROPERTY_NAME));
+        assertEquals(REQUIRED_DEFAULT_PROPERTY_VALUE, 
workingPropertyValue(repeatedRead, REQUIRED_DEFAULT_PROPERTY_NAME));
+        assertFalse(new File(STATE_DIRECTORY, "saved-config.json").exists());

Review Comment:
   I am ok with this in a follow up PR



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to