Class TestingApi

java.lang.Object
software.xdev.mailpit.client.BaseApi
software.xdev.mailpit.api.TestingApi

public class TestingApi extends BaseApi
  • Constructor Details

    • TestingApi

      public TestingApi()
    • TestingApi

      public TestingApi(ApiClient apiClient)
  • Method Details

    • getChaos

      public ChaosTriggers getChaos() throws ApiException
      Get Chaos triggers Returns the current Chaos triggers configuration. This API route will return an error if Chaos is not enabled at runtime.
      Returns:
      ChaosTriggers
      Throws:
      ApiException - if fails to make API call
    • getChaos

      public ChaosTriggers getChaos(Map<String,String> additionalHeaders) throws ApiException
      Get Chaos triggers Returns the current Chaos triggers configuration. This API route will return an error if Chaos is not enabled at runtime.
      Parameters:
      additionalHeaders - additionalHeaders for this call
      Returns:
      ChaosTriggers
      Throws:
      ApiException - if fails to make API call
    • getMessageHTMLParams

      public String getMessageHTMLParams(@Nonnull String ID, @Nullable String embed) throws ApiException
      Render message HTML part Renders just the message's HTML part which can be used for UI integration testing. Attached inline images are modified to link to the API provided they exist. Note that is the message does not contain a HTML part then an 404 error is returned. The ID can be set to `latest` to return the latest message.
      Parameters:
      ID - Message database ID or \"latest\" (required)
      embed - If this is route is to be embedded in an iframe, set embed to `1` in the URL to add `target=\"_blank\"` and `rel=\"noreferrer noopener\"` to all links. In addition, a small script will be added to the end of the document to post (postMessage()) the height of the document back to the parent window for optional iframe height resizing. Note that this will also *transform* the message into a full HTML document (if it isn't already), so this option is useful for viewing but not programmatic testing. (optional)
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • getMessageHTMLParams

      public String getMessageHTMLParams(@Nonnull String ID, @Nullable String embed, Map<String,String> additionalHeaders) throws ApiException
      Render message HTML part Renders just the message's HTML part which can be used for UI integration testing. Attached inline images are modified to link to the API provided they exist. Note that is the message does not contain a HTML part then an 404 error is returned. The ID can be set to `latest` to return the latest message.
      Parameters:
      ID - Message database ID or \"latest\" (required)
      embed - If this is route is to be embedded in an iframe, set embed to `1` in the URL to add `target=\"_blank\"` and `rel=\"noreferrer noopener\"` to all links. In addition, a small script will be added to the end of the document to post (postMessage()) the height of the document back to the parent window for optional iframe height resizing. Note that this will also *transform* the message into a full HTML document (if it isn't already), so this option is useful for viewing but not programmatic testing. (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • getMessageTextParams

      public String getMessageTextParams(@Nonnull String ID) throws ApiException
      Render message text part Renders just the message's text part which can be used for UI integration testing. The ID can be set to `latest` to return the latest message.
      Parameters:
      ID - Message database ID or \"latest\" (required)
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • getMessageTextParams

      public String getMessageTextParams(@Nonnull String ID, Map<String,String> additionalHeaders) throws ApiException
      Render message text part Renders just the message's text part which can be used for UI integration testing. The ID can be set to `latest` to return the latest message.
      Parameters:
      ID - Message database ID or \"latest\" (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • setChaosParams

      public ChaosTriggers setChaosParams(@Nullable ChaosTriggers body) throws ApiException
      Set Chaos triggers Set the Chaos triggers configuration and return the updated values. This API route will return an error if Chaos is not enabled at runtime. If any triggers are omitted from the request, then those are reset to their default values with a 0% probability (ie: disabled). Setting a blank `{}` will reset all triggers to their default values.
      Parameters:
      body - (optional)
      Returns:
      ChaosTriggers
      Throws:
      ApiException - if fails to make API call
    • setChaosParams

      public ChaosTriggers setChaosParams(@Nullable ChaosTriggers body, Map<String,String> additionalHeaders) throws ApiException
      Set Chaos triggers Set the Chaos triggers configuration and return the updated values. This API route will return an error if Chaos is not enabled at runtime. If any triggers are omitted from the request, then those are reset to their default values with a 0% probability (ie: disabled). Setting a blank `{}` will reset all triggers to their default values.
      Parameters:
      body - (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      ChaosTriggers
      Throws:
      ApiException - if fails to make API call
    • invokeAPI

      public <T> T invokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String,String> additionalHeaders) throws ApiException
      Description copied from class: BaseApi
      Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
      Specified by:
      invokeAPI in class BaseApi
      Parameters:
      url - The URL for the request, either full URL or only the path.
      method - The HTTP method for the request.
      request - The request object.
      returnType - The return type.
      additionalHeaders - Additional headers for the request.
      Returns:
      The API response in the specified type.
      Throws:
      ApiException - if fails to make API call.