Package software.xdev.mailpit.api
Class TestingApi
java.lang.Object
software.xdev.mailpit.client.BaseApi
software.xdev.mailpit.api.TestingApi
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetChaos()Get Chaos triggers Returns the current Chaos triggers configuration.Get Chaos triggers Returns the current Chaos triggers configuration.getMessageHTMLParams(String ID, String embed) Render message HTML part Renders just the message's HTML part which can be used for UI integration testing.Render message HTML part Renders just the message's HTML part which can be used for UI integration testing.Render message text part Renders just the message's text part which can be used for UI integration testing.getMessageTextParams(String ID, Map<String, String> additionalHeaders) Render message text part Renders just the message's text part which can be used for UI integration testing.<T> TinvokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String, String> additionalHeaders) Directly invoke the API for the given URL.setChaosParams(ChaosTriggers body) Set Chaos triggers Set the Chaos triggers configuration and return the updated values.setChaosParams(ChaosTriggers body, Map<String, String> additionalHeaders) Set Chaos triggers Set the Chaos triggers configuration and return the updated values.Methods inherited from class software.xdev.mailpit.client.BaseApi
getApiClient, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, setApiClient
-
Constructor Details
-
TestingApi
public TestingApi() -
TestingApi
-
-
Method Details
-
getChaos
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
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
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 ApiExceptionRender 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
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 ApiExceptionRender 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
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 ApiExceptionSet 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 ApiExceptionDescription copied from class:BaseApiDirectly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.- Specified by:
invokeAPIin classBaseApi- 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.
-