diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/wag/AbstractAWSGatewayApiProcessor.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/wag/AbstractAWSGatewayApiProcessor.java index 7cde727fa0..66068a863e 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/wag/AbstractAWSGatewayApiProcessor.java +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/wag/AbstractAWSGatewayApiProcessor.java @@ -402,7 +402,7 @@ public abstract class AbstractAWSGatewayApiProcessor extends context.getProperty(PROP_METHOD).evaluateAttributeExpressions(requestFlowFile) .getValue()).toUpperCase(); final HttpMethodName methodName = HttpMethodName.fromValue(method); - return configureRequest(context, session, resourcePath,requestFlowFile, methodName, attributes); + return configureRequest(context, session, resourcePath, requestFlowFile, methodName, attributes); } protected GenericApiGatewayRequest configureRequest(final ProcessContext context, @@ -414,7 +414,7 @@ public abstract class AbstractAWSGatewayApiProcessor extends GenericApiGatewayRequestBuilder builder = new GenericApiGatewayRequestBuilder() .withResourcePath(resourcePath); - final Map> parameters = getParameters(context); + final Map> parameters = getParameters(context, attributes); builder = builder.withParameters(parameters); InputStream requestBody; @@ -522,15 +522,16 @@ public abstract class AbstractAWSGatewayApiProcessor extends * Returns a map of Query Parameter Name to Values * * @param context ProcessContext + * @param flowFileAttributes map of FlowFile attributes used for EL evaluation * @return Map of names and values */ - protected Map> getParameters(final ProcessContext context) { + protected Map> getParameters(final ProcessContext context, Map flowFileAttributes) { if (!context.getProperty(PROP_QUERY_PARAMS).isSet()) { return new HashMap<>(); } final String queryString = context.getProperty(PROP_QUERY_PARAMS) - .evaluateAttributeExpressions().getValue(); + .evaluateAttributeExpressions(flowFileAttributes).getValue(); final List params = URLEncodedUtils .parse(queryString, Charsets.toCharset("UTF-8")); diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/wag/TestInvokeAmazonGatewayApiMock.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/wag/TestInvokeAmazonGatewayApiMock.java index 5b7927dd31..b3a4a970e8 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/wag/TestInvokeAmazonGatewayApiMock.java +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/wag/TestInvokeAmazonGatewayApiMock.java @@ -178,7 +178,7 @@ public class TestInvokeAmazonGatewayApiMock { // add dynamic property runner.setProperty("dynamicHeader", "yes!"); - runner.setProperty(InvokeAWSGatewayApi.PROP_QUERY_PARAMS, "apples=oranges&dogs=cats"); + runner.setProperty(InvokeAWSGatewayApi.PROP_QUERY_PARAMS, "apples=oranges&dogs=cats&filename=${filename}"); // set the regex runner.setProperty(InvokeAWSGatewayApi.PROP_ATTRIBUTES_TO_SEND, "F.*"); @@ -186,6 +186,7 @@ public class TestInvokeAmazonGatewayApiMock { final Map attributes = new HashMap<>(); attributes.put(CoreAttributes.MIME_TYPE.key(), "application/plain-text"); attributes.put("Foo", "Bar"); + attributes.put("filename", "testfile"); runner.enqueue("Hello".getBytes(StandardCharsets.UTF_8), attributes); // execute runner.assertValid(); @@ -197,7 +198,7 @@ public class TestInvokeAmazonGatewayApiMock { && argument.getFirstHeader("Authorization").getValue().startsWith("AWS4") && argument.getFirstHeader("dynamicHeader").getValue().equals("yes!") && argument.getFirstHeader("Foo").getValue().equals("Bar") - && argument.getURI().toString().equals("https://foobar.execute-api.us-east-1.amazonaws.com/TEST?dogs=cats&apples=oranges")), + && argument.getURI().toString().equals("https://foobar.execute-api.us-east-1.amazonaws.com/TEST?filename=testfile&dogs=cats&apples=oranges")), any(HttpContext.class)); // check runner.assertTransferCount(InvokeAWSGatewayApi.REL_SUCCESS_REQ, 1);