bobpaulin commented on code in PR #11677:
URL: https://github.com/apache/nifi/pull/11677#discussion_r4040830396


##########
nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/connectors/ConnectorChangeVersionIT.java:
##########
@@ -0,0 +1,151 @@
+/*
+ * 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.tests.system.connectors;
+
+import org.apache.nifi.components.connector.ConnectorState;
+import org.apache.nifi.nar.NarState;
+import org.apache.nifi.tests.system.NiFiSystemIT;
+import org.apache.nifi.tests.system.nar.NarUploadUtil;
+import org.apache.nifi.toolkit.cli.impl.command.CommandOption;
+import 
org.apache.nifi.toolkit.cli.impl.command.nifi.connectors.ChangeVersionConnector;
+import org.apache.nifi.web.api.dto.ConfigurationStepConfigurationDTO;
+import org.apache.nifi.web.api.dto.ConnectorConfigurationDTO;
+import org.apache.nifi.web.api.dto.ConnectorValueReferenceDTO;
+import org.apache.nifi.web.api.dto.NarSummaryDTO;
+import org.apache.nifi.web.api.dto.PropertyGroupConfigurationDTO;
+import org.apache.nifi.web.api.entity.ConnectorEntity;
+import org.apache.nifi.web.api.entity.ProcessGroupFlowEntity;
+import org.junit.jupiter.api.Test;
+
+import java.io.File;
+import java.util.Map;
+import java.util.Properties;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class ConnectorChangeVersionIT extends NiFiSystemIT {
+
+    private static final String NARS_LOCATION = 
"target/nifi-connector-change-version-nars";
+    private static final String VERSION_ONE_NAR_ID = 
"nifi-connector-change-version-v1-nar";
+    private static final String VERSION_TWO_NAR_ID = 
"nifi-connector-change-version-v2-nar";
+    private static final String CONNECTOR_TYPE = 
"org.apache.nifi.connectors.tests.system.changeversion.ChangeVersionTestConnector";
+    private static final String BUNDLE_GROUP = "org.apache.nifi";
+    private static final String BUNDLE_ARTIFACT = 
"nifi-connector-change-version-nar";
+    private static final String VERSION_ONE = "1.0.0";
+    private static final String VERSION_TWO = "2.0.0";
+    private static final String SETTINGS_STEP = "Settings";
+    private static final String SHARED_PROPERTY = "Shared Property";
+    private static final String NEW_PROPERTY = "New Property";
+    private static final String CUSTOM_SHARED_VALUE = "kept-across-reload";
+    private static final String VERSION_ONE_FLOW_NAME = "Change Version Flow 
v1";
+    private static final String VERSION_TWO_DEFAULT = "version-two-default";
+
+    @Override
+    protected boolean isDestroyEnvironmentAfterEachTest() {
+        return true;
+    }
+
+    @Test
+    public void 
testChangeConnectorNarVersionPreservesManagedFlowAndOverlappingConfiguration() 
throws Exception {

Review Comment:
   Can we add case where we change back from Version 2 to Version 1?   Would it 
be up to the connector to error if changing version is not supported?  Might be 
good to have a case in to exercise the behavior also to verify Troubleshooting 
behavior.
   
   [Grok 4.6]
   A revert after that would exercise different contract:
   
   * still the same managed PG id
   * still the v1 flow name (not swapped to "Change Version Flow v2")
   * shared property still "kept-across-reload"
   * what happens to the v2-only New Property once the type is back on v1 
(dropped vs leftover in stored config)
   
   That last point is the real reason to add a revert, not symmetry for its own 
sake. It can live in the same test after the upgrade, or as a second method if 
isolation is preferred (isDestroyEnvironmentAfterEachTest is already true).



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