Reputation: 327
I am implementing a AWS Lambda that gets triggered from SQS, and then do some other thing. This is my current Handler:
how I can pass a fake SQSEvent to test my function?
public class Handler implements RequestHandler<SQSEvent, Void> {
@Override
public Void handleRequest(SQSEvent sqsEvent, Context context) {
helper(sqsEvent.record);
return null;
}
}
Upvotes: 2
Views: 6511
Reputation: 1948
The aws-lambda-java-tests
helps to simplify java lambda testing. Please refer here for details.
For sample code, refer Testing AWS Lambda functions written in Java blog.
Upvotes: 3