Class ContainerConnectionDetailsFactory<C extends org.testcontainers.containers.Container<?>,D extends ConnectionDetails>

java.lang.Object
org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory<C,D>
Type Parameters:
D - the connection details type
C - the container type
All Implemented Interfaces:
ConnectionDetailsFactory<ContainerConnectionSource<C>,D>

public abstract class ContainerConnectionDetailsFactory<C extends org.testcontainers.containers.Container<?>,D extends ConnectionDetails> extends Object implements ConnectionDetailsFactory<ContainerConnectionSource<C>,D>
Base class for ConnectionDetailsFactory implementations that provide ConnectionDetails from a ContainerConnectionSource.
Since:
3.1.0
Author:
Moritz Halbritter, Andy Wilkinson, Phillip Webb
  • Field Details

    • ANY_CONNECTION_NAME

      protected static final String ANY_CONNECTION_NAME
      Constant passed to the constructor when any connection name is accepted.
  • Constructor Details

    • ContainerConnectionDetailsFactory

      protected ContainerConnectionDetailsFactory()
      Create a new ContainerConnectionDetailsFactory instance that accepts any connection name.
    • ContainerConnectionDetailsFactory

      protected ContainerConnectionDetailsFactory(String connectionName, String... requiredClassNames)
      Create a new ContainerConnectionDetailsFactory instance with the given connection name restriction.
      Parameters:
      connectionName - the required connection name or ANY_CONNECTION_NAME
      requiredClassNames - the names of classes that must be present
    • ContainerConnectionDetailsFactory

      protected ContainerConnectionDetailsFactory(List<String> connectionNames, String... requiredClassNames)
      Create a new ContainerConnectionDetailsFactory instance with the given supported connection names.
      Parameters:
      connectionNames - the supported connection names
      requiredClassNames - the names of classes that must be present
      Since:
      3.4.0
  • Method Details