I have some code that uploads and downloads files using AWS S3 (using the Java AWS SDK). I want to be able to write some tests for it, I was wondering if anyone has any good options. Ideally I would like a light-weight S3 server that runs locally that can be started fast and requires no system configuration (the tests need to be run by Jenkins).
Some options I have looked at so far:
Object storage is amazingly versatile. We normally associate it with AWS S3, but Object Storage can also be run on your private network with MinIO. In this article, I'll show you how to install MinIO using Docker and also on a Mac using homebrew.
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to create a bucket policy for or whose bucket policy you want to edit. Choose Permissions. Under Bucket policy, choose Edit.
Prepare and run sample ApplicationSend POST request to http://localhost:4000/api/document/ and pass the files using form-data with a key as a file, and value with an image. I recommend localstack if you are building applications and using AWS services.
This guide explains the Amazon Simple Storage Service (Amazon S3) application programming interface (API). It describes various API operations, related request and response structures, and error codes. The current version of the Amazon S3 API is 2006-03-01.
You can try localstack, which is an open source local AWS cloud stack made for testing. It provides implementations of several of AWS services, including S3.
It looks like a very popular open source project on GitHub.
You can try installing minio server on your laptop/system, its open source & single static binary. Server is S3 compatible. Then you can try minio-java client library for all operations, following is basic operations example.
Installing minio server [GNU/Linux]
$ wget https://dl.minio.io/server/minio/release/linux-amd64/minio $ chmod 755 minio $ ./minio --help
Hope it helps Disclaimer: I work for Minio
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