How would one run aws lambda locally (java) for testing.
I was able to find some information for node, but not for java.
AFAIK there is no magic to actually triggering the lambda function locally. Take a look at: http://docs.aws.amazon.com/lambda/latest/dg/java-programming-model-req-resp.html
and
http://docs.aws.amazon.com/lambda/latest/dg/java-gs.html
Depending what your lambda code does you need to build the input and (possibly the context) and pass them into the function writing your own small test wrapper.
Unless you are doing this for unit testing it does not make sense to go through the trouble though. If you are doing this for testing you will probably need to mock out other external AWS services that your lambda might use.
You can use AWS Toolkit for Eclipse if you want to perform local testing for Amazon Lambda functions, and build serverless applications in Amazon.
But since Aug 11, 2017, Amazon provides the AWS SAM Local, a CLI tool that allows us to locally test and debug our AWS Lambda functions. SAM Local supports Lambda functions written in Node.js, Java, and Python.
Please vote for implementing Intellij IDEA support for Amazon Lambda here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With