Experimental
@aws-cdk/integ-tests-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
InvocationType Enum
The type of invocation.
Default is REQUEST_RESPONSE
Example
ts
declare const app: App;
declare const stack: Stack;
declare const queue: sqs.Queue;
declare const fn: lambda.IFunction;
const integ = new IntegTest(app, 'Integ', {
testCases: [stack],
});
integ.assertions.invokeFunction({
functionName: fn.functionName,
invocationType: InvocationType.EVENT,
payload: JSON.stringify({ status: 'OK' }),
});
const message = integ.assertions.awsApiCall('SQS', 'receiveMessage', {
QueueUrl: queue.queueUrl,
WaitTimeSeconds: 20,
});
message.assertAtPath('Messages.0.Body', ExpectedResult.objectLike({
requestContext: {
condition: 'Success',
},
requestPayload: {
status: 'OK',
},
responseContext: {
statusCode: 200,
},
responsePayload: 'success',
}));
Members
| Member | Description |
|---|---|
EVENT | Invoke the function asynchronously. |
REQUEST_RESPONSE | Invoke the function synchronously. |
DRY_RUN | Validate parameter values and verify that the user or role has permission to invoke the function. |
Referenced by
LambdaInvokeFunctionProps.invocationTypeinvocation_typeinvocationTypeInvocationTypeInvocationType