GH-943 Enhance AWS FunctionInvoker
This adds another constructor which allows function.definition to be passed as a constructor argument rather then rely on the property Resolves #943
This commit is contained in:
@@ -578,6 +578,19 @@ public class FunctionInvokerTests {
|
||||
assertThat(result).contains("arn:aws:sqs:eu-central-1:123456789012:MyQueue");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSQSEventWithConstructorArg() throws Exception {
|
||||
System.setProperty("MAIN_CLASS", SQSConfiguration.class.getName());
|
||||
FunctionInvoker invoker = new FunctionInvoker("inputSQSEvent");
|
||||
|
||||
InputStream targetStream = new ByteArrayInputStream(this.sampleSQSEvent.getBytes());
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||
invoker.handleRequest(targetStream, output, null);
|
||||
|
||||
String result = new String(output.toByteArray(), StandardCharsets.UTF_8);
|
||||
assertThat(result).contains("arn:aws:sqs:eu-central-1:123456789012:MyQueue");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSQSEventAsMessage() throws Exception {
|
||||
System.setProperty("MAIN_CLASS", SQSConfiguration.class.getName());
|
||||
|
||||
Reference in New Issue
Block a user