Class ContainerConnectionDetailsFactory<A extends Annotation,D extends ConnectionDetails,C extends org.testcontainers.containers.GenericContainer<?>>
java.lang.Object
org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory<A,D,C>
- Type Parameters:
A
- the source annotation type. The annotation will be mergable to a@ServiceConnection
.D
- the connection details typeC
- the generic container type
- All Implemented Interfaces:
ConnectionDetailsFactory<ContainerConnectionSource<A,
D, C>, D>
public abstract class ContainerConnectionDetailsFactory<A extends Annotation,D extends ConnectionDetails,C extends org.testcontainers.containers.GenericContainer<?>>
extends Object
implements ConnectionDetailsFactory<ContainerConnectionSource<A,D,C>,D>
Base class for
ConnectionDetailsFactory
implementations that provide
ConnectionDetails
from a ContainerConnectionSource
.- Since:
- 3.1.0
- Author:
- Moritz Halbritter, Andy Wilkinson, Phillip Webb
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Convenient base class forConnectionDetails
results that are backed by aContainerConnectionSource
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal D
getConnectionDetails
(ContainerConnectionSource<A, D, C> source) Get theConnectionDetails
from the givensource
.protected abstract D
-
Constructor Details
-
ContainerConnectionDetailsFactory
public ContainerConnectionDetailsFactory()
-
-
Method Details
-
getConnectionDetails
Description copied from interface:ConnectionDetailsFactory
- Specified by:
getConnectionDetails
in interfaceConnectionDetailsFactory<A extends Annotation,
D extends ConnectionDetails> - Parameters:
source
- the source- Returns:
- the connection details or
null
-
getContainerConnectionDetails
Get theConnectionDetails
from the givenContainerConnectionSource
source
. May returnnull
if no connection can be created. Result types should consider extendingContainerConnectionDetailsFactory.ContainerConnectionDetails
.- Parameters:
source
- the source- Returns:
- the service connection or
null
.
-