Skip to content

manybrain/mailinator-java-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to build this package

Prerequisites
  • ensure you have maven3 installed and Java8
    • verify it by mvn -version
Verified, what next ?
  • build package by mvn clean install
    • built packages are located in target directory:
      • mailinator-client-${version}.jar
      • mailinator-client-${version}-sources.jar
      • mailinator-client-${version}-javadoc.jar

How to use it

Add dependency:

    <dependencies>
        <dependency>
            <groupId>com.manybrain</groupId>
            <artifactId>mailinator-client</artifactId>
            <version>${version}</version>
        </dependency>
    </dependencies>

Usage example

Create MailinatorClient
MailinatorClient mailinatorClient = new MailinatorClient("yourApiKeyHere");
Get all messages from domain
Inbox inbox = mailinatorClient.request(new GetInboxRequest("yourDomainNameHere"));
Get paginated messages from domain and inbox
Inbox inbox = mailinatorClient.request(GetInboxRequest.builder()
                                                       .domain("yourDomainNameHere")
                                                       .limit(1)
                                                       .skip(0)
                                                       .sort(Sort.ASC)
                                                       .build());
Get message
Message message = mailinatorClient.request(new GetMessageRequest(
                                                                "yourDomainNameHere", 
                                                                "test", 
                                                                "test-1574418771-2639"));

Build tests

By default, most of the tests are skipped.

Build with tests

Most of the tests require env variables with valid values. Visit tests source code and review @EnabledIfEnvironmentVariable annotated parts. The more env variables you set, the more tests are run.

  • MAILINATOR_TEST_API_TOKEN - API tokens for authentication; basic requirement across many tests;see also https://manybrain.github.io/m8rdocs/#api-authentication
  • MAILINATOR_TEST_DOMAIN_PRIVATE - private domain; visit https://www.mailinator.com/
  • MAILINATOR_TEST_INBOX - some already existing inbox within the private domain
  • MAILINATOR_TEST_PHONE_NUMBER - associated phone number within the private domain; see also https://manybrain.github.io/m8rdocs/#fetch-an-sms-messages
  • MAILINATOR_TEST_MESSAGE_WITH_ATTACHMENT_ID - existing message id within inbox (see above) within private domain (see above); see also https://manybrain.github.io/m8rdocs/#fetch-message
  • MAILINATOR_TEST_ATTACHMENT_ID - existing message id within inbox (see above) within private domain (see above); see also https://manybrain.github.io/m8rdocs/#fetch-message
  • MAILINATOR_TEST_DELETE_DOMAIN - don't use it unless you are 100% sure what you are doing
  • MAILINATOR_TEST_WEBHOOKTOKEN_PRIVATEDOMAIN - private domain for webhook token
  • MAILINATOR_TEST_WEBHOOKTOKEN_CUSTOMSERVICE - custom service for webhook token
  • MAILINATOR_TEST_AUTH_SECRET - authenticator secret
  • MAILINATOR_TEST_AUTH_ID - authenticator id
  • MAILINATOR_TEST_WEBHOOK_INBOX - inbox for webhook
  • MAILINATOR_TEST_WEBHOOK_CUSTOMSERVICE - custom service for webhook

Release and deploy to maven central

mvn -B -Psign release:prepare release:perform deploy

About

Java Client for the Mailinator Email System

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages