Class ContainerConnectionSource<C extends org.testcontainers.containers.Container<?>>

java.lang.Object
org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource<C>
Type Parameters:
C - the generic container type
All Implemented Interfaces:
OriginProvider

public final class ContainerConnectionSource<C extends org.testcontainers.containers.Container<?>> extends Object implements OriginProvider
Passed to ContainerConnectionDetailsFactory to provide details of the @ServiceConnection annotated Container that provides the service.
Since:
3.1.0
Author:
Moritz Halbritter, Andy Wilkinson, Phillip Webb
See Also:
  • Method Details

    • getOrigin

      public Origin getOrigin()
      Description copied from interface: OriginProvider
      Return the source origin or null if the origin is not known.
      Specified by:
      getOrigin in interface OriginProvider
      Returns:
      the origin or null
    • getContainer

      public C getContainer()
      Return the Container that implements the service being connected to.
      Returns:
      the Container providing the service
    • toString

      public String toString()
      Overrides:
      toString in class Object