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@ServiceConnectionD- 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 theGenericContainerthat implements the service being connected to.Return the source origin ornullif 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 theGenericContainerthat implements the service being connected to.- Returns:
- the
GenericContainerproviding the service
-
getOrigin
Description copied from interface:OriginProviderReturn the source origin ornullif the origin is not known.- Specified by:
getOriginin interfaceOriginProvider- Returns:
- the origin or
null
-
toString
-