Class EnvPropertyLookup

  • All Implemented Interfaces:
    org.apache.commons.text.lookup.StringLookup

    public class EnvPropertyLookup
    extends Object
    implements org.apache.commons.text.lookup.StringLookup
    Custom lookup for getting values from properties files
    • Constructor Detail

      • EnvPropertyLookup

        public EnvPropertyLookup()
    • Method Detail

      • lookup

        public String lookup​(String key)
        The file that contains all common configuration for the project (environment independent configuration) must be located in /resources/configuration/common.properties

        Environment-specific configuration can be located in a separated file. This configuration can override the configuration from the common file. All environment specific configuration files can be included at runtime via maven variable, setting the 'env' to the name of the file.

        for example, to use properties from the file pre.properties located in /resources/configuration/pre.properties, just pass -Denv=pre when running your tests

        Specified by:
        lookup in interface org.apache.commons.text.lookup.StringLookup
        Parameters:
        key - property to locate
        Returns:
        value of the property