Class Mailpit
java.lang.Object
com.irurueta.authserver.testsupport.Mailpit
Describes the Mailpit container the one-time token tests read the e-mail of: the pinned image, its two ports and a
factory that builds the container and the client of its HTTP API. Mailpit accepts any message over SMTP and exposes
what it received over HTTP, so a test reads the code or the link the application mailed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intPort the HTTP API listens on inside the container.static final StringDocker image of Mailpit, pinned to a version so a run never depends on a moving tag.private static final StringPath that answers once the HTTP API is ready.static final intPort the SMTP server listens on inside the container. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MailpitClientclientOf(org.testcontainers.containers.GenericContainer<?> container) Builds the client of the HTTP API of a started container.static org.testcontainers.containers.GenericContainer<?> Creates a Mailpit container, not yet started.
-
Field Details
-
IMAGE
Docker image of Mailpit, pinned to a version so a run never depends on a moving tag.- See Also:
-
SMTP_PORT
public static final int SMTP_PORTPort the SMTP server listens on inside the container.- See Also:
-
API_PORT
public static final int API_PORTPort the HTTP API listens on inside the container.- See Also:
-
READY_PATH
Path that answers once the HTTP API is ready.- See Also:
-
-
Constructor Details
-
Mailpit
private Mailpit()Prevents instantiation of this utility class.
-
-
Method Details
-
newContainer
public static org.testcontainers.containers.GenericContainer<?> newContainer()Creates a Mailpit container, not yet started.- Returns:
- the container, which waits for the HTTP API to answer before it counts as started.
-
clientOf
Builds the client of the HTTP API of a started container.- Parameters:
container- a started Mailpit container.- Returns:
- the client.
-