Class ContainerConnectionSource<A extends Annotation,D extends ConnectionDetails,C extends org.testcontainers.containers.GenericContainer<?>>

java.lang.Object
org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource<A,D,C>
Type Parameters:
A - the source annotation type. The annotation will mergable to a @ServiceConnection
D - the connection details type
C - the generic container type
All Implemented Interfaces:
OriginProvider

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

    • getAnnotation

      public A getAnnotation()
      Return the source annotation that provided the connection to the container. This annotation will be mergable to @ServiceConnection.
      Returns:
      the source annotation
    • getContainer

      public C getContainer()
      Return the GenericContainer that implements the service being connected to.
      Returns:
      the GenericContainer providing the service
    • 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