nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pvillard31 <...@git.apache.org>
Subject [GitHub] nifi pull request #1034: [NIFI-2810] Allow Content Type to be set in PutS3Ob...
Date Fri, 23 Sep 2016 14:05:50 GMT
Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1034#discussion_r80250891
  
    --- Diff: nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/s3/ITPutS3Object.java
---
    @@ -238,6 +238,26 @@ public void testMetaData() throws IOException {
         }
     
         @Test
    +    public void testContentType() throws IOException {
    +        PutS3Object processor = new PutS3Object();
    +        final TestRunner runner = TestRunners.newTestRunner(processor);
    +
    +        runner.setProperty(PutS3Object.CREDENTIALS_FILE, CREDENTIALS_FILE);
    +        runner.setProperty(PutS3Object.REGION, REGION);
    +        runner.setProperty(PutS3Object.BUCKET, BUCKET_NAME);
    +        runner.setProperty(PutS3Object.CONTENT_TYPE, "text/plain");
    +
    +        runner.enqueue(getResourcePath(SAMPLE_FILE_RESOURCE_NAME));
    +
    +        runner.run();
    +
    +        runner.assertAllFlowFilesTransferred(PutS3Object.REL_SUCCESS, 1);
    +        List<MockFlowFile> flowFiles = runner.getFlowFilesForRelationship(PutS3Object.REL_SUCCESS);
    +        MockFlowFile ff1 = flowFiles.get(0);
    +        ff1.assertAttributeEquals(PutS3Object.S3_CONTENT_TYPE, "text/plain");
    --- End diff --
    
    If I understand the unit test correctly, there will be a new attribute written into the
flow file (``s3.contenttype``). Could you add the corresponding ``@WritesAttribute`` annotation
at the top of the ``PutS3Object`` class?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message