Package io.micronaut.testresources.core
Interface TestResourcesResolver
- All Superinterfaces:
io.micronaut.core.order.Ordered
- All Known Subinterfaces:
TestResourcesClient
,ToggableTestResourcesResolver
- All Known Implementing Classes:
AbstractHibernateReactiveTestResourceProvider
,AbstractJdbcTestResourceProvider
,AbstractR2DBCTestResourceProvider
,AbstractTestContainersProvider
,DefaultTestResourcesClient
,ElasticsearchTestResourceProvider
,GenericTestContainerProvider
,HibernateReactiveMariaDBTestResourceProvider
,HibernateReactiveMSSQLTestResourceProvider
,HibernateReactiveMySQLTestResourceProvider
,HibernateReactiveOracleXETestResourceProvider
,HibernateReactivePostgreSQLTestResourceProvider
,HiveMQTestResourceProvider
,KafkaTestResourceProvider
,LocalStackTestResourceProvider
,MariaDBTestResourceProvider
,MongoDBTestResourceProvider
,MSSQLTestResourceProvider
,MySQLTestResourceProvider
,Neo4jTestResourceProvider
,OracleXETestResourceProvider
,PostgreSQLTestResourceProvider
,R2DBCMariaDBTestResourceProvider
,R2DBCMSSQLTestResourceProvider
,R2DBCMySQLTestResourceProvider
,R2DBCOracleXETestResourceProvider
,R2DBCPoolTestResourceProvider
,R2DBCPostgreSQLTestResourceProvider
,RabbitMQTestResourceProvider
,RedisClusterTestResourceProvider
,RedisTestResourceProvider
,TestResourcesController
,VaultTestResourceProvider
public interface TestResourcesResolver
extends io.micronaut.core.order.Ordered
A test resources resolver is responsible for resolving test
resources. This should be done when the
resolve(String, Map, Map)
method is called. This method is called with a property, corresponding
to a property which doesn't exist in the user configuration.
For example, if the "jdbc.driver" property is missing, a resolver
may declare that it can resolve that property.
As part of the process, it may start a test container for example.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name of the top-level test resources property configuration key.Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Returns a display name for a test resources resolver, used for debugging purposes.default String
getId()
Returns an id for the resolver.getRequiredProperties
(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.Resolves the given property.Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Field Details
-
TEST_RESOURCES_PROPERTY
The name of the top-level test resources property configuration key.- See Also:
-
-
Method Details
-
getDisplayName
Returns a display name for a test resources resolver, used for debugging purposes.- Returns:
- the display name
-
getId
Returns an id for the resolver.- Returns:
- the id
-
getResolvableProperties
List<String> getResolvableProperties(Map<String, Collection<String>> propertyEntries, Map<String, Object> testResourcesConfig) Returns 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 callinggetRequiredPropertyEntries()
and values are those property entries resolved.- Parameters:
propertyEntries
- the property entriestestResourcesConfig
- the test resources configuration- Returns:
- the list of properties
-
getRequiredProperties
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.- Parameters:
expression
- the expression which needs to be resolved.- Returns:
- the list of configuration properties this resolver requires
-
getRequiredPropertyEntries
-
resolve
Optional<String> resolve(String propertyName, Map<String, Object> properties, Map<String, Object> testResourcesConfig) Resolves the given property.- Parameters:
propertyName
- the property to resolveproperties
- the resolved required propertiestestResourcesConfig
- the test resources configuration- Returns:
- the resolved property or empty if not found
-