All Projects → adobe → S3mock

adobe / S3mock

Licence: other
A simple mock implementation of the AWS S3 API startable as Docker image, JUnit 4 rule, or JUnit Jupiter extension

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to S3mock

Rome
Carthage cache for S3, Minio, Ceph, Google Storage, Artifactory and many others
Stars: ✭ 724 (+118.07%)
Mutual labels:  aws, s3, aws-s3
Awslib scala
An idiomatic Scala wrapper around the AWS Java SDK
Stars: ✭ 20 (-93.98%)
Mutual labels:  aws, s3, aws-s3
S3 Sync Action
🔄 GitHub Action to sync a directory with a remote S3 bucket 🧺
Stars: ✭ 497 (+49.7%)
Mutual labels:  aws, s3, aws-s3
Discharge
⚡️ A simple, easy way to deploy static websites to Amazon S3.
Stars: ✭ 483 (+45.48%)
Mutual labels:  aws, s3, aws-s3
0x4447 product s3 email
📫 A serverless email server on AWS using S3 and SES
Stars: ✭ 2,905 (+775%)
Mutual labels:  aws, s3, aws-s3
Aws S3 Scala
Scala client for Amazon S3
Stars: ✭ 35 (-89.46%)
Mutual labels:  aws, s3, aws-s3
S3 Permission Checker
Check read, write permissions on S3 buckets in your account
Stars: ✭ 18 (-94.58%)
Mutual labels:  aws, s3, aws-s3
Aws.s3
Amazon Simple Storage Service (S3) API Client
Stars: ✭ 302 (-9.04%)
Mutual labels:  aws, s3, aws-s3
Terraform Aws S3 Bucket
Terraform module which creates S3 bucket resources on AWS
Stars: ✭ 130 (-60.84%)
Mutual labels:  aws, s3, aws-s3
Sbt S3 Resolver
☁️Amazon S3-based resolver for sbt
Stars: ✭ 112 (-66.27%)
Mutual labels:  aws, s3, aws-s3
Kafka Connect Storage Cloud
Kafka Connect suite of connectors for Cloud storage (Amazon S3)
Stars: ✭ 153 (-53.92%)
Mutual labels:  aws, s3, aws-s3
Node S3 Uploader
Flexible and efficient resize, rename, and upload images to Amazon S3 disk storage. Uses the official AWS Node SDK for transfer, and ImageMagick for image processing. Support for multiple image versions targets.
Stars: ✭ 237 (-28.61%)
Mutual labels:  aws, s3, aws-s3
Bucket-Flaws
Bucket Flaws ( S3 Bucket Mass Scanner ): A Simple Lightweight Script to Check for Common S3 Bucket Misconfigurations
Stars: ✭ 43 (-87.05%)
Mutual labels:  aws-s3, s3
terraform-aws-s3-object
Terraform module which creates S3 object resources on AWS
Stars: ✭ 15 (-95.48%)
Mutual labels:  aws-s3, s3
fss3
FSS3 is an S3 filesystem abstraction layer for Golang
Stars: ✭ 52 (-84.34%)
Mutual labels:  aws-s3, s3
ionic-image-upload
Ionic Plugin for Uploading Images to Amazon S3
Stars: ✭ 26 (-92.17%)
Mutual labels:  aws-s3, s3
flask-drive
A simple Flask app to upload and download files off Amazon's S3
Stars: ✭ 23 (-93.07%)
Mutual labels:  aws-s3, s3
Dive-Into-AWS
Links to the Repos and Sections in our Dive into AWS Course.
Stars: ✭ 27 (-91.87%)
Mutual labels:  aws-s3, s3
punic
Punic is a remote cache CLI built for Carthage and Apple .xcframework
Stars: ✭ 25 (-92.47%)
Mutual labels:  aws-s3, s3
Raccoon
Raccoon is a lightweight response mocking framework that can be easily integrated into the Android UI tests.
Stars: ✭ 47 (-85.84%)
Mutual labels:  mock, junit

Latest Version Docker Hub Maven Build JAVA Docker Pulls GitHub stars

S3Mock

Introduction

S3Mock is a lightweight server that implements parts of the Amazon S3 API. It has been created to support hermetic testing and reduces the infrastructure dependencies while testing.

The mock server can be started as a Docker container, through the JUnit4 and JUnit5 support, or programmatically.

Similar projects are e.g.:

Usage

Using the Docker image

Starting on the command-line:

docker run -p 9090:9090 -p 9191:9191 -t adobe/s3mock

The port 9090 is for HTTP, port 9191 is for HTTPS.

Configuration

The mock can be configured with the following environment parameters:

  • validKmsKeys: list of KMS Key-Refs that are to be treated as valid.
  • initialBuckets: list of names for buckets that will be available initially.
  • root: the base directory to place the temporary files exposed by the mock.
Starting with the Docker Maven Plugin

Our integration tests are using the Amazon S3 Client to verify the server functionality against the S3Mock. During the Maven build, the Docker image is started using the docker-maven-plugin and the corresponding ports are passed to the JUnit test through the maven-failsafe-plugin. See AmazonClientUploadIT how it's used in the code.

This way, one can easily switch between calling the S3Mock or the real S3 endpoint and this doesn't add any additional Java dependencies to the project.

Using the JUnit4 Rule

The example S3MockRuleTest demonstrates the usage of the S3MockRule, which can be configured through a builder.

To use the JUnit4 Rule, use the following Maven artifact in test scope:

<dependency>
 <groupId>com.adobe.testing</groupId>
 <artifactId>s3mock-junit4</artifactId>
 <version>...</version>
 <scope>test</scope>
</dependency>

Using the JUnit5 Extension

The S3MockExtension can currently be used in two ways:

  1. Declaratively using @ExtendWith(S3MockExtension.class) and by injecting a properly configured instance of AmazonS3 client and/or the started S3MockApplication to the tests. See examples: S3MockExtensionDeclarativeTest (for SDKv1) or S3MockExtensionDeclarativeTest (for SDKv2)

  2. Programmatically using @RegisterExtension and by creating and configuring the S3MockExtension using a builder. See examples: S3MockExtensionProgrammaticTest (for SDKv1) or S3MockExtensionProgrammaticTest (for SDKv2)

To use the JUnit5 Extension, use the following Maven artifact in test scope:

<dependency>
  <groupId>com.adobe.testing</groupId>
  <artifactId>s3mock-junit5</artifactId>
  <version>...</version>
  <scope>test</scope>
</dependency>

Using the TestNG Listener

The example S3MockListenerXMLConfigurationTest demonstrates the usage of the S3MockListener, which can be configured as shown in testng.xml. The listener bootstraps S3Mock application before TestNG execution starts and shuts down the application just before the execution terminates. Please refer to IExecutionListener

To use the TestNG Listener, use the following Maven artifact in test scope:

<dependency>
 <groupId>com.adobe.testing</groupId>
 <artifactId>s3mock-testng</artifactId>
 <version>...</version>
 <scope>test</scope>
</dependency>

Starting Programmatically

Include the following dependency and use one of the start methods in com.adobe.testing.s3mock.S3MockApplication:

<dependency>
  <groupId>com.adobe.testing</groupId>
  <artifactId>s3mock</artifactId>
  <version>...</version>
</dependency>

Build & Run

To build this project, you need Docker, JDK 8 or higher, and Maven:

mvn clean install

You can run the S3Mock from the sources by either of the following methods:

  • Run or Debug the class com.adobe.testing.s3mock.S3MockApplication in the IDE.
  • using Docker:
    • mvn clean package -pl server -am -DskipTests
    • docker run -p 9090:9090 -p 9191:9191 -t adobe/s3mock:latest
  • using the Docker Maven plugin:
    • mvn clean package docker:start -pl server -am -DskipTests -Ddocker.follow -Dit.s3mock.port_http=9090 -Dit.s3mock.port_https=9191 (stop with ctrl-c)

Once the application is started, you can execute the *IT tests from your IDE.

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].