Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.29 KB

README.md

File metadata and controls

40 lines (27 loc) · 1.29 KB

testing-aws-lambdas

About

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.

Further reading

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.

Running the tests

  • including component tests ./mvnw verify

Prerequisites

  • the following programmes are required on your machine
    • Java 11
    • Docker

Further improvements

  • implement testing for other clouds
    • implement different EventHandlers for each cloud
    • implement Services analogue to S3Adapter
    • write tests

Thanks

I would like to thank my employer OpenValue for allowing me to publish the results of my research.