Class R2DBCPostgreSQLTestResourceProvider
java.lang.Object
io.micronaut.testresources.testcontainers.AbstractTestContainersProvider<T>
io.micronaut.testresources.r2dbc.core.AbstractR2DBCTestResourceProvider<org.testcontainers.containers.PostgreSQLContainer<?>>
io.micronaut.testresources.r2dbc.postgres.R2DBCPostgreSQLTestResourceProvider
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,TestResourcesResolver
,ToggableTestResourcesResolver
public class R2DBCPostgreSQLTestResourceProvider
extends AbstractR2DBCTestResourceProvider<org.testcontainers.containers.PostgreSQLContainer<?>>
A test resource provider for reactive PostgreSQL.
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Fields inherited from interface io.micronaut.testresources.core.TestResourcesResolver
TEST_RESOURCES_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.testcontainers.containers.PostgreSQLContainer<?>
createContainer
(org.testcontainers.utility.DockerImageName imageName, Map<String, Object> requestedProperties, Map<String, Object> testResourcesConfig) Creates the test container.protected Optional<io.r2dbc.spi.ConnectionFactoryOptions>
extractOptions
(org.testcontainers.containers.GenericContainer<?> container) Returns the list of db-types supported by this provider.protected String
Returns the default image name.Returns a display name for a test resources resolver, used for debugging purposes.protected String
Returns the name of the resource resolver, for example "kafka" or "mysql".Methods inherited from class io.micronaut.testresources.r2dbc.core.AbstractR2DBCTestResourceProvider
getRequiredProperties, getRequiredPropertyEntries, getResolvableProperties, resolveProperty, resolveWithoutContainer, shouldAnswer
Methods inherited from class io.micronaut.testresources.testcontainers.AbstractTestContainersProvider
configureContainer, getName, getOrder, isEnabled, resolve, stringOrNull
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.testresources.core.TestResourcesResolver
getId
-
Field Details
-
DISPLAY_NAME
- See Also:
-
-
Constructor Details
-
R2DBCPostgreSQLTestResourceProvider
public R2DBCPostgreSQLTestResourceProvider()
-
-
Method Details
-
getDisplayName
Description copied from interface:TestResourcesResolver
Returns a display name for a test resources resolver, used for debugging purposes.- Returns:
- the display name
-
getSimpleName
Description copied from class:AbstractTestContainersProvider
Returns the name of the resource resolver, for example "kafka" or "mysql".- Specified by:
getSimpleName
in classAbstractTestContainersProvider<org.testcontainers.containers.PostgreSQLContainer<?>>
- Returns:
- the name of the resolver
-
getDefaultImageName
Description copied from class:AbstractTestContainersProvider
Returns the default image name.- Specified by:
getDefaultImageName
in classAbstractTestContainersProvider<org.testcontainers.containers.PostgreSQLContainer<?>>
- Returns:
- the default image name.
-
getDbTypes
Description copied from class:AbstractR2DBCTestResourceProvider
Returns the list of db-types supported by this provider.- Overrides:
getDbTypes
in classAbstractR2DBCTestResourceProvider<org.testcontainers.containers.PostgreSQLContainer<?>>
- Returns:
- the list of db types
-
extractOptions
protected Optional<io.r2dbc.spi.ConnectionFactoryOptions> extractOptions(org.testcontainers.containers.GenericContainer<?> container) - Specified by:
extractOptions
in classAbstractR2DBCTestResourceProvider<org.testcontainers.containers.PostgreSQLContainer<?>>
-
createContainer
protected org.testcontainers.containers.PostgreSQLContainer<?> createContainer(org.testcontainers.utility.DockerImageName imageName, Map<String, Object> requestedProperties, Map<String, Object> testResourcesConfig) Description copied from class:AbstractTestContainersProvider
Creates the test container.- Specified by:
createContainer
in classAbstractTestContainersProvider<org.testcontainers.containers.PostgreSQLContainer<?>>
- Parameters:
imageName
- the docker image namerequestedProperties
- the resolved propertiestestResourcesConfig
- the test resources configuration- Returns:
- a container
-