You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "markap14 (via GitHub)" <gi...@apache.org> on 2023/04/27 19:59:09 UTC

[GitHub] [nifi] markap14 commented on a diff in pull request #7201: NIFI-11493: Fix properties dynamically modifying the classpath with default values

markap14 commented on code in PR #7201:
URL: https://github.com/apache/nifi/pull/7201#discussion_r1179621826


##########
nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/processor/DefaultedDynamicClassPathModificationIT.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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.processor;
+
+import org.apache.nifi.tests.system.NiFiSystemIT;
+import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
+import org.apache.nifi.web.api.entity.ConnectionEntity;
+import org.apache.nifi.web.api.entity.ProcessorEntity;
+import org.junit.jupiter.api.Test;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class DefaultedDynamicClassPathModificationIT extends NiFiSystemIT {
+
+    private ProcessorEntity generateFlowFileProcessor;
+    private ProcessorEntity defaultedModifyClasspathProcessor;
+
+    private ConnectionEntity defaultedModifyClasspathInputConnection;
+    private ConnectionEntity successConnection;
+    private ConnectionEntity failureConnection;
+
+    @Test
+    void testLoadsClassFromDefaultedDynamicModification() throws NiFiClientException, IOException, InterruptedException {
+        createFlow();
+
+        // Update modify to have the appropriate URL, don't update URL to load to let it on default value
+        final Map<String, String> propertyMap = new HashMap<>();
+        propertyMap.put("Class to Load", "org.apache.commons.lang3.StringUtils");
+        getClientUtil().updateProcessorProperties(defaultedModifyClasspathProcessor, propertyMap);
+        getClientUtil().waitForValidProcessor(defaultedModifyClasspathProcessor.getId());
+
+        // Create a FlowFile
+        getClientUtil().startProcessor(generateFlowFileProcessor);

Review Comment:
   Need to waitForValidProcessor before starting it



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org