Interface Waitable

All Superinterfaces:
Serializable
All Known Implementing Classes:
Healthcheck, LogLine, None, TcpPort

public sealed interface Waitable extends Serializable permits Healthcheck, LogLine, TcpPort, None
Strategy that determines when start<ContainerName> considers a container ready. This is a sealed contract: implementations are the records Healthcheck (waits for the image's Docker HEALTHCHECK to report healthy), LogLine (waits for a regex match in container logs), TcpPort (waits for a TCP port to accept connections), and None (no readiness check). Serializable so values survive Gradle's configuration cache.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static Waitable
    Wait until the container's Docker HEALTHCHECK reports healthy.
    static Waitable
    logLine(String regex)
    Wait until a line matching regex appears in the container's stdout/stderr stream.
    static Waitable
    No readiness check; the start task returns as soon as docker run returns.
    static Waitable
    tcpPort(int port)
    Wait until the given TCP port inside the container accepts a connection.
  • Method Details

    • healthcheck

      static Waitable healthcheck()
      Wait until the container's Docker HEALTHCHECK reports healthy. Fails fast at start time if the image declares no HEALTHCHECK.
      Returns:
      a Healthcheck marker
    • logLine

      static Waitable logLine(String regex)
      Wait until a line matching regex appears in the container's stdout/stderr stream.
      Parameters:
      regex - Java regular expression matched against each log line
      Returns:
      a LogLine strategy bound to regex
    • tcpPort

      static Waitable tcpPort(int port)
      Wait until the given TCP port inside the container accepts a connection.
      Parameters:
      port - container-side TCP port to probe
      Returns:
      a TcpPort strategy bound to port
    • none

      static Waitable none()
      No readiness check; the start task returns as soon as docker run returns.
      Returns:
      a None marker