sdairs commented on a change in pull request #5367:
URL: https://github.com/apache/nifi/pull/5367#discussion_r702342707



##########
File path: 
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/sns/TestPutSNS.java
##########
@@ -89,6 +89,41 @@ public void testPublish() throws IOException {
         ff0.assertAttributeEquals(CoreAttributes.FILENAME.key(), "1.txt");
     }
 
+    @Test
+    public void testPublishFIFO() throws IOException {
+        runner.setProperty(PutSNS.CREDENTIALS_FILE, 
"src/test/resources/mock-aws-credentials.properties");
+        runner.setProperty(PutSNS.ARN, 
"arn:aws:sns:us-west-2:123456789012:test-topic-1.fifo");
+        runner.setProperty(PutSNS.SUBJECT, "${eval.subject}");
+        runner.setProperty(PutSNS.MESSAGEDEDUPLICATIONID, "${myuuid}");
+        runner.setProperty(PutSNS.MESSAGEGROUPID, "test1234");
+        assertTrue(runner.setProperty("DynamicProperty", "hello!").isValid());
+        final Map<String, String> ffAttributes = new HashMap<>();
+        ffAttributes.put("filename", "1.txt");
+        ffAttributes.put("eval.subject", "test-subject");
+        ffAttributes.put("myuuid", "fb0dfed8-092e-40ee-83ce-5b576cd26236");
+        runner.enqueue("Test Message Content", ffAttributes);
+
+        PublishResult mockPublishResult = new PublishResult();
+        
Mockito.when(mockSNSClient.publish(Mockito.any(PublishRequest.class))).thenReturn(mockPublishResult);
+
+        runner.run();
+
+        ArgumentCaptor<PublishRequest> captureRequest = 
ArgumentCaptor.forClass(PublishRequest.class);
+        Mockito.verify(mockSNSClient, 
Mockito.times(1)).publish(captureRequest.capture());
+        PublishRequest request = captureRequest.getValue();
+        assertEquals("arn:aws:sns:us-west-2:123456789012:test-topic-1", 
request.getTopicArn());

Review comment:
       Forgot to update the topic name to match the .fifo suffix in assert




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