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

pvillard pushed a commit to branch support/nifi-1.x
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/support/nifi-1.x by this push:
     new f7c06d39a7 NIFI-12071 add deprecation notices to grpc processors and 
fix brittle test depending on certain command line output
f7c06d39a7 is described below

commit f7c06d39a7c8983bae307d27574119ddcf6dc256
Author: Joseph Witt <[email protected]>
AuthorDate: Fri Sep 15 12:10:03 2023 -0700

    NIFI-12071 add deprecation notices to grpc processors and fix brittle test 
depending on certain command line output
    
    Signed-off-by: Pierre Villard <[email protected]>
    
    This closes #7741.
---
 .../src/main/java/org/apache/nifi/processors/grpc/InvokeGRPC.java     | 2 ++
 .../src/main/java/org/apache/nifi/processors/grpc/ListenGRPC.java     | 2 ++
 .../org/apache/nifi/processors/standard/TestExecuteStreamCommand.java | 4 ++--
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/main/java/org/apache/nifi/processors/grpc/InvokeGRPC.java
 
b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/main/java/org/apache/nifi/processors/grpc/InvokeGRPC.java
index e97ee47661..e6c787c9b8 100644
--- 
a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/main/java/org/apache/nifi/processors/grpc/InvokeGRPC.java
+++ 
b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/main/java/org/apache/nifi/processors/grpc/InvokeGRPC.java
@@ -45,6 +45,7 @@ import org.apache.nifi.processor.exception.ProcessException;
 import org.apache.nifi.processor.util.StandardValidators;
 import org.apache.nifi.processors.grpc.ssl.SslContextProvider;
 import org.apache.nifi.ssl.SSLContextService;
+import org.apache.nifi.annotation.documentation.DeprecationNotice;
 
 import java.io.InputStream;
 import java.net.InetAddress;
@@ -74,6 +75,7 @@ import java.util.concurrent.atomic.AtomicReference;
         @WritesAttribute(attribute = "invokegrpc.java.exception.class", 
description = "The Java exception class raised when the processor fails"),
         @WritesAttribute(attribute = "invokegrpc.java.exception.message", 
description = "The Java exception message raised when the processor fails"),
 })
+@DeprecationNotice(reason = "No planned alternatives to be offered. Use custom 
processors instead.")
 public class InvokeGRPC extends AbstractProcessor {
     public static final String RESPONSE_CODE = "invokegrpc.response.code";
     public static final String RESPONSE_BODY = "invokegrpc.response.body";
diff --git 
a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/main/java/org/apache/nifi/processors/grpc/ListenGRPC.java
 
b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/main/java/org/apache/nifi/processors/grpc/ListenGRPC.java
index 5e059a13d1..f04ecd3689 100644
--- 
a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/main/java/org/apache/nifi/processors/grpc/ListenGRPC.java
+++ 
b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/main/java/org/apache/nifi/processors/grpc/ListenGRPC.java
@@ -45,6 +45,7 @@ import org.apache.nifi.processors.grpc.ssl.SslContextProvider;
 import org.apache.nifi.processors.grpc.util.BackpressureChecker;
 import org.apache.nifi.ssl.RestrictedSSLContextService;
 import org.apache.nifi.ssl.SSLContextService;
+import org.apache.nifi.annotation.documentation.DeprecationNotice;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -65,6 +66,7 @@ import java.util.regex.Pattern;
         @WritesAttribute(attribute = GRPCAttributeNames.REMOTE_USER_DN, 
description = "The DN of the user who sent the FlowFile to this NiFi"),
         @WritesAttribute(attribute = GRPCAttributeNames.REMOTE_HOST, 
description = "The IP of the client who sent the FlowFile to this NiFi")
 })
+@DeprecationNotice(reason = "No planned alternatives to be offered. Use custom 
processors instead.")
 public class ListenGRPC extends AbstractSessionFactoryProcessor {
 
     // properties
diff --git 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExecuteStreamCommand.java
 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExecuteStreamCommand.java
index d4f7fac4ab..3b0d29ca86 100644
--- 
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExecuteStreamCommand.java
+++ 
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExecuteStreamCommand.java
@@ -175,7 +175,7 @@ public class TestExecuteStreamCommand {
         List<MockFlowFile> flowFiles = 
controller.getFlowFilesForRelationship(ExecuteStreamCommand.NONZERO_STATUS_RELATIONSHIP);
         MockFlowFile flowFile = flowFiles.get(0);
         assertEquals(0, flowFile.getSize());
-        assertEquals("Error: Unable to access jarfile", 
flowFile.getAttribute("execution.error").substring(0, 31));
+        assertTrue(flowFile.getAttribute("execution.error").contains("Error: 
Unable to access jarfile"));
         assertTrue(flowFile.isPenalized());
     }
 
@@ -208,7 +208,7 @@ public class TestExecuteStreamCommand {
         List<MockFlowFile> flowFiles = 
controller.getFlowFilesForRelationship(ExecuteStreamCommand.NONZERO_STATUS_RELATIONSHIP);
         MockFlowFile flowFile = flowFiles.get(0);
         assertEquals(0, flowFile.getSize());
-        assertEquals("Error: Unable to access jarfile", 
flowFile.getAttribute("execution.error").substring(0, 31));
+        assertTrue(flowFile.getAttribute("execution.error").contains("Error: 
Unable to access jarfile"));
         assertTrue(flowFile.isPenalized());
     }
 

Reply via email to