This is a simple example of an AWS Serverless Lambda Function. It takes an image from a bucket in S3, creates a thumbnail of it and uploads it back to S3.
This project aims to show how the code of a lambda should be structured, so it can be tested easily using Unit tests, Integration tests and Component tests. Unit tests can easily be created using manual Dependency Injection. Integration and Component tests use a combination of Testcontainers and LocalStack to test the lambda independent of the AWS cloud.
I held a talk about testing aws lambdas. This code is used for demonstration purposes in this talk. You can watch the talk online on my website.
- including component tests
./mvnw verify
- the following programmes are required on your machine
- Java 11
- Docker
- implement testing for other clouds
- implement different EventHandlers for each cloud
- implement Services analogue to S3Adapter
- write tests
I would like to thank my employer OpenValue for allowing me to publish the results of my research.