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

    • accepts

      public boolean accepts(String requiredConnectionName, Class<?> requiredContainerType, Class<?> requiredConnectionDetailsType)
      Return if this source accepts the given connection.
      Parameters:
      requiredConnectionName - the required connection name or null
      requiredContainerType - the required container type
      requiredConnectionDetailsType - the required connection details type
      Returns:
      if the connection is accepted by this source
      Since:
      3.4.0
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object