Package io.micronaut.testresources.core
Interface PropertyExpressionProducer
public interface PropertyExpressionProducer
Implementations are responsible for generating the list
of keys that a test resource resolver is able to resolve.
-
Method Summary
Modifier and TypeMethodDescriptionThe list of property entries that the producer needs to know about in order to provide the list of keys that it can resolve.produceKeys
(io.micronaut.core.io.ResourceLoader resourceLoader, Map<String, Collection<String>> propertyEntries, Map<String, Object> testResourcesConfig) Returns the list of keys the resolver is able to generate.
-
Method Details
-
getPropertyEntries
The list of property entries that the producer needs to know about in order to provide the list of keys that it can resolve. For example, a resolver may need to know about the "datasources" names. For this, it would return a list containing the string "datasources".- Returns:
- the property entries needed by the resolver
-
produceKeys
List<String> produceKeys(io.micronaut.core.io.ResourceLoader resourceLoader, Map<String, Collection<String>> propertyEntries, Map<String, Object> testResourcesConfig) Returns the list of keys the resolver is able to generate. This is called with the list of resolved property entries. The property entries map therefore contains one entry for each property returned by thegetPropertyEntries()
method. For example, if thegetPropertyEntries()
method returns a single-entry list with "datasources", then the map will contain a single entry with "datasources" as the key, and the datasource names as the value. The producer can then generate a list of keys for each datasource name.- Parameters:
resourceLoader
- the resource loaderpropertyEntries
- the map of resolved property entriestestResourcesConfig
- the test resources configuration- Returns:
- the list of keys
-