This is an automated email from the ASF dual-hosted git repository.
exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 2e3f83eb54 NIFI-12387 Initialize Controller Service Comments with
Empty String
2e3f83eb54 is described below
commit 2e3f83eb54cbc040b5a1da5bce9a74a558f08ea4
Author: Nissim Shiman <[email protected]>
AuthorDate: Fri Jan 19 15:40:06 2024 +0000
NIFI-12387 Initialize Controller Service Comments with Empty String
The empty string allows controller service configuration to be saved
without flow
configuration history recording a configuration change for comments.
This closes #8275
Signed-off-by: David Handermann <[email protected]>
---
.../apache/nifi/controller/service/StandardControllerServiceNode.java | 1 +
.../src/test/java/org/apache/nifi/controller/TestFlowController.java | 2 ++
2 files changed, 3 insertions(+)
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java
index 78cad4a151..97cfc010d9 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java
@@ -136,6 +136,7 @@ public class StandardControllerServiceNode extends
AbstractComponentNode impleme
this.active = new AtomicBoolean();
setControllerServiceAndProxy(implementation, proxiedControllerService,
invocationHandler);
stateTransition = new ServiceStateTransition(this);
+ this.comment = "";
}
@Override
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFlowController.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFlowController.java
index 963f7fd9c6..c207934ee3 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFlowController.java
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFlowController.java
@@ -860,6 +860,7 @@ public class TestFlowController {
assertEquals(ServiceA.class.getSimpleName(),
controllerServiceNode.getComponentType());
assertEquals(ServiceA.class.getCanonicalName(),
controllerServiceNode.getComponent().getClass().getCanonicalName());
assertEquals(LogLevel.WARN, controllerServiceNode.getBulletinLevel());
+ assertEquals("", controllerServiceNode.getComments());
controller.getReloadComponent().reload(controllerServiceNode,
ServiceB.class.getName(), coordinate, Collections.emptySet());
@@ -868,6 +869,7 @@ public class TestFlowController {
assertEquals(id, controllerServiceNode.getComponent().getIdentifier());
assertEquals(coordinate.getCoordinate(),
controllerServiceNode.getBundleCoordinate().getCoordinate());
assertEquals(LogLevel.WARN, controllerServiceNode.getBulletinLevel());
+ assertEquals("", controllerServiceNode.getComments());
// in this test we happened to change between two services that have
different canonical class names
// but in the running application the DAO layer would call
verifyCanUpdateBundle and would prevent this so