Class AbstractHibernateReactiveTestResourceProvider<T extends org.testcontainers.containers.JdbcDatabaseContainer<? extends T>>
java.lang.Object
io.micronaut.testresources.testcontainers.AbstractTestContainersProvider<T>
io.micronaut.testresources.hibernate.reactive.core.AbstractHibernateReactiveTestResourceProvider<T>
- Type Parameters:
- T- the container type
- All Implemented Interfaces:
- io.micronaut.core.order.Ordered,- TestResourcesResolver,- ToggableTestResourcesResolver
- Direct Known Subclasses:
- HibernateReactiveMariaDBTestResourceProvider,- HibernateReactiveMSSQLTestResourceProvider,- HibernateReactiveMySQLTestResourceProvider,- HibernateReactiveOracleXETestResourceProvider,- HibernateReactivePostgreSQLTestResourceProvider
public abstract class AbstractHibernateReactiveTestResourceProvider<T extends org.testcontainers.containers.JdbcDatabaseContainer<? extends T>>
extends AbstractTestContainersProvider<T>
Base class for R2DBC test resources. Unlike JDBC test resources, this
 resolver is capable of reusing an existing JDBC test resources and
 expose it via R2DBC: this can be useful for Flyway database migrations
 which work over JDBC for example. For this to work, a datasource of
 the same name must exist, in which case it would be resolved first.
 If no such datasource exists, then a new container will be created.
- 
Field SummaryFields inherited from interface io.micronaut.core.order.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCEFields inherited from interface io.micronaut.testresources.core.TestResourcesResolverTEST_RESOURCES_PROPERTY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetRequiredProperties(String expression) Returns the list of properties which should be read before resolving an expression: this can be used if the resolver itself needs some configuration properties.getResolvableProperties(Map<String, Collection<String>> propertyEntries, Map<String, Object> testResourcesConfig) Returns the list of properties that this resolver is able to support.resolveProperty(String expression, T container) resolveWithoutContainer(String propertyName, Map<String, Object> properties, Map<String, Object> testResourcesConfig) Lets a resolver provide a value for the requested property without triggering the creation of a test container.protected booleanshouldAnswer(String propertyName, Map<String, Object> requestedProperties, Map<String, Object> testResourcesConfig) Determines if this resolver can resolve the requested property.Methods inherited from class io.micronaut.testresources.testcontainers.AbstractTestContainersProviderconfigureContainer, createContainer, getDefaultImageName, getName, getOrder, getSimpleName, isEnabled, resolve, stringOrNullMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.testresources.core.TestResourcesResolvergetIdMethods inherited from interface io.micronaut.testresources.core.ToggableTestResourcesResolvergetDisplayName
- 
Constructor Details- 
AbstractHibernateReactiveTestResourceProviderpublic AbstractHibernateReactiveTestResourceProvider()
 
- 
- 
Method Details- 
getRequiredPropertyEntries
- 
getRequiredPropertiesDescription copied from interface:TestResourcesResolverReturns the list of properties which should be read before resolving an expression: this can be used if the resolver itself needs some configuration properties.- Parameters:
- expression- the expression which needs to be resolved.
- Returns:
- the list of configuration properties this resolver requires
 
- 
getResolvablePropertiespublic List<String> getResolvableProperties(Map<String, Collection<String>> propertyEntries, Map<String, Object> testResourcesConfig) Description copied from interface:TestResourcesResolverReturns the list of properties that this resolver is able to support. The property entries map is a map which keys are the property entries retrieved from callingTestResourcesResolver.getRequiredPropertyEntries()and values are those property entries resolved.- Parameters:
- propertyEntries- the property entries
- testResourcesConfig- the test resources configuration
- Returns:
- the list of properties
 
- 
shouldAnswerprotected boolean shouldAnswer(String propertyName, Map<String, Object> requestedProperties, Map<String, Object> testResourcesConfig) Description copied from class:AbstractTestContainersProviderDetermines if this resolver can resolve the requested property. It is used in order to make sure that a "Postgres" resolver wouldn't provide a value if the requested container type is for MySQL, for example.- Overrides:
- shouldAnswerin class- AbstractTestContainersProvider<T extends org.testcontainers.containers.JdbcDatabaseContainer<? extends T>>
- Parameters:
- propertyName- the property to resolve
- requestedProperties- the resolved properties
- testResourcesConfig- the test resources configuration
- Returns:
- if this resolver should answer
 
- 
resolveWithoutContainerprotected Optional<String> resolveWithoutContainer(String propertyName, Map<String, Object> properties, Map<String, Object> testResourcesConfig) Description copied from class:AbstractTestContainersProviderLets a resolver provide a value for the requested property without triggering the creation of a test container. This can be used in case a resolver wants to check existing containers first.- Overrides:
- resolveWithoutContainerin class- AbstractTestContainersProvider<T extends org.testcontainers.containers.JdbcDatabaseContainer<? extends T>>
- Parameters:
- propertyName- the name of the property to resolve
- properties- the properties used to resolve
- testResourcesConfig- the test resources configuration
- Returns:
- a resolved property
 
- 
resolveProperty- Specified by:
- resolvePropertyin class- AbstractTestContainersProvider<T extends org.testcontainers.containers.JdbcDatabaseContainer<? extends T>>
 
 
-