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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to