diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSProcessor.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSProcessor.java index 47672fc639..44da97832e 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSProcessor.java +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSProcessor.java @@ -154,6 +154,7 @@ public abstract class AbstractAWSProcessor attrs = new HashMap<>(); attrs.put("filename", "1.txt"); runner.enqueue(Paths.get("src/test/resources/hello.txt"), attrs); - runner.setProperty(PutSQS.AWS_CREDENTIALS_PROVIDER_SERVICE, "awsCredentialsProvider"); runner.run(1); - final List flowFiles = runner.getFlowFilesForRelationship(PutSQS.REL_SUCCESS); - for (final MockFlowFile mff : flowFiles) { - System.out.println(mff.getAttributes()); - System.out.println(new String(mff.toByteArray())); - } + runner.assertAllFlowFilesTransferred(PutSQS.REL_SUCCESS, 1); + } + @Test + public void testVpceEndpoint() throws IOException { + // additional AWS environment setup for testing VPCE endpoints: + // - create an Interface Endpoint in your VPC for SQS (https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#create-interface-endpoint) + // - create a Client VPN Endpoint in your VPC (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-getting-started.html) + // and connect your local machine (running the test) to your VPC via VPN + // - alternatively, the test can be run on an EC2 instance located on the VPC + + final TestRunner runner = TestRunners.newTestRunner(new PutSQS()); + runner.setProperty(PutSQS.CREDENTIALS_FILE, System.getProperty("user.home") + "/aws-credentials.properties"); + runner.setProperty(PutSQS.REGION, Regions.US_WEST_2.getName()); + runner.setProperty(PutSQS.QUEUE_URL, VPCE_QUEUE_URL); + runner.setProperty(PutSQS.ENDPOINT_OVERRIDE, VPCE_ENDPOINT_OVERRIDE); + + runner.enqueue(Paths.get("src/test/resources/hello.txt")); + runner.run(1); + + runner.assertAllFlowFilesTransferred(PutSQS.REL_SUCCESS, 1); } }