This is an automated email from the ASF dual-hosted git repository.

bbende pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/master by this push:
     new f89ea8c  NIFI-6645: Fixed problem in unit test for 
StandardParameterContext because behavior changed; fixed issue in 
StandardParameterContext around adding a parameter with no description
f89ea8c is described below

commit f89ea8cf2130348e752286d0e76173f52c3d6912
Author: Mark Payne <[email protected]>
AuthorDate: Mon Sep 9 14:59:40 2019 -0400

    NIFI-6645: Fixed problem in unit test for StandardParameterContext because 
behavior changed; fixed issue in StandardParameterContext around adding a 
parameter with no description
    
    This closes #3714.
    
    Signed-off-by: Bryan Bende <[email protected]>
---
 .../main/java/org/apache/nifi/parameter/StandardParameterContext.java   | 2 +-
 .../java/org/apache/nifi/parameter/TestStandardParameterContext.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/parameter/StandardParameterContext.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/parameter/StandardParameterContext.java
index ecd8cfa..157c09f 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/parameter/StandardParameterContext.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/parameter/StandardParameterContext.java
@@ -172,7 +172,7 @@ public class StandardParameterContext implements 
ParameterContext {
 
         // We know that the Parameters have the same name, since this is what 
the Descriptor's hashCode & equality are based on. The only thing that may be 
different
         // is the description. And since the proposed Parameter does not have 
a Description, we want to use whatever is currently set.
-        return oldParameter == null ? null : oldParameter.getDescriptor();
+        return oldParameter == null ? descriptor : 
oldParameter.getDescriptor();
     }
 
     @Override
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/parameter/TestStandardParameterContext.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/parameter/TestStandardParameterContext.java
index 6008e63..6710163 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/parameter/TestStandardParameterContext.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/parameter/TestStandardParameterContext.java
@@ -125,7 +125,7 @@ public class TestStandardParameterContext {
         abcParam = context.getParameter("abc").get();
         assertEquals(abcDescriptor, abcParam.getDescriptor());
         assertEquals("Updated Again", 
abcParam.getDescriptor().getDescription());
-        assertNull(abcParam.getValue());
+        assertEquals("321", abcParam.getValue());
     }
 
     @Test

Reply via email to