koustavtub / snsmockjava

SNS Mock Repo for Publishing https://github.com/s12v/sns to Maven Central and allowing to be used on java

GitHub

Purpose

SNS Mock Repo for Publishing https://github.com/s12v/sns to Maven Central

Usage

Add dependency:

        <dependency>
            <groupId>io.github.koustavtub</groupId>
            <artifactId>snsmockjava</artifactId>
            <version>0.4.1</version>
            <scope>test</scope>
        </dependency>

Use a random available port:

int randomPort = MockSNSServer.start();

or use on a specific port,

int specificPort = 8800;
MockSNSServer.start(specificPort);

Requires Java8.

Configuration

Configuration can be set via environment variables:

  • DB_PATH - path to subscription database file, default: db.json
  • HTTP_INTERFACE - interface to bind to, default: 0.0.0.0
  • HTTP_PORT - tcp port, default: 9911

Note: Environment variables can be used to specify URIs via {{env:ENV_NAME}}.

Example: aws-sqs://{{env:QUEUE_NAME}}?amazonSQSEndpoint={{env:SQS_ENDPOINT}}&...

Checksum

Use pgp key from PGP 0x0FB37A4F

Credits

All credits to: https://github.com/s12v/sns This project is just for easier use on Java by using an included wrapper.