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 ornull
requiredContainerType
- the required container typerequiredConnectionDetailsType
- the required connection details type- Returns:
- if the connection is accepted by this source
- Since:
- 3.4.0
-
getOrigin
Description copied from interface:OriginProvider
Return the source origin ornull
if the origin is not known.- Specified by:
getOrigin
in interfaceOriginProvider
- Returns:
- the origin or
null
-
toString
-