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 typeC
- 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 Summary
Modifier and TypeMethodDescriptionReturn the source annotation that provided the connection to the container.Return theGenericContainer
that implements the service being connected to.Return the source origin ornull
if the origin is not known.toString()
-
Method Details
-
getAnnotation
Return the source annotation that provided the connection to the container. This annotation will be mergable to@ServiceConnection
.- Returns:
- the source annotation
-
getContainer
Return theGenericContainer
that implements the service being connected to.- Returns:
- the
GenericContainer
providing the service
-
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
-