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 Type
    Method
    Description
    default List<String>
    The 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

      default List<String> 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 the getPropertyEntries() method. For example, if the getPropertyEntries() 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 loader
      propertyEntries - the map of resolved property entries
      testResourcesConfig - the test resources configuration
      Returns:
      the list of keys