Package com.privalia.qa.lookups
Class EnvPropertyLookup
- java.lang.Object
-
- com.privalia.qa.lookups.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 Summary
Constructors Constructor Description EnvPropertyLookup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
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.propertiesEnvironment-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 interfaceorg.apache.commons.text.lookup.StringLookup
- Parameters:
key
- property to locate- Returns:
- value of the property
-
-