You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/11/14 16:43:25 UTC

[GitHub] [nifi] thenatog commented on a diff in pull request #6649: NIFI-10785 Allow publishing AMQP message with null header value

thenatog commented on code in PR #6649:
URL: https://github.com/apache/nifi/pull/6649#discussion_r1021806878


##########
nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/test/java/org/apache/nifi/amqp/processors/PublishAMQPTest.java:
##########
@@ -134,14 +124,10 @@ public void validateSuccessWithHeaderWithCommaPublishToSuccess() throws Exceptio
 
         final Map<String, Object> headerMap = msg1.getProps().getHeaders();
 
-        final Object foo = headerMap.get("foo");
-        final Object foo2 = headerMap.get("foo2");
-        final Object foo3 = headerMap.get("foo3");
-
-        assertEquals("(bar,bar)", foo.toString());
-        assertEquals("bar2", foo2.toString());
-        assertNull(foo3);
-
+        assertEquals(2, headerMap.size());
+        assertEquals("(bar,bar)", headerMap.get("foo").toString());

Review Comment:
   In these tests, is it possible we can use a pre-defined header map to compare these values?
   
   ```
       private static Map<String, String> EXPECTED_HEADERS  = new HashMap<String, String>() {{
           put("foo", "(bar,bar)");
           put("foo2", "bar2");
           put("foo3", null);
       }};
   ```
       
   And a method (something like assertExpectedHeaders(msg1.getProps().getHeaders() { ... }) to assert the header values match the above map?



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