Interface EnvironmentVariables

All Known Implementing Classes:
MockEnvironmentVariables, SystemEnvironmentVariables

public interface EnvironmentVariables
Return system environment variable values.
  • Method Details

    • getValue

      String getValue(String name)
    • getValue

      String getValue(Enum<?> property)
    • getValue

      String getValue(String name, String defaultValue)
    • getValue

      String getValue(Enum<?> property, String defaultValue)
    • getPropertyAsInteger

      Integer getPropertyAsInteger(String name, Integer defaultValue)
    • getPropertyAsInteger

      Integer getPropertyAsInteger(Enum<?> property, Integer defaultValue)
    • getPropertyAsBoolean

      Boolean getPropertyAsBoolean(String name, boolean defaultValue)
    • getPropertyAsBoolean

      Boolean getPropertyAsBoolean(Enum<?> property, boolean defaultValue)
    • getProperty

      String getProperty(String name)
    • optionalProperty

      Optional<String> optionalProperty(String name)
      Returns an optional system property. The property may be defined in the project's serenity.properties or serenity.conf file, or be provided as a a system property. This is designed particularly for user-provided properties, to make it easier to store test confiuration properties in a single file.

      Sample usage: ``` EnvironmentVariables environmentVariables;

      String environment = environmentVariables.optionalProperty("env").orElse("DEV") ```

    • getProperty

      String getProperty(Enum<?> property)
    • getProperty

      String getProperty(String name, String defaultValue)
    • getProperty

      String getProperty(Enum<?> property, String defaultValue)
    • setProperty

      void setProperty(String name, String value)
    • setProperties

      void setProperties(Map<String,String> properties)
    • clearProperty

      void clearProperty(String name)
    • copy

    • getKeys

      List<String> getKeys()
    • getProperties

      Properties getProperties()
    • getPropertiesWithPrefix

      Properties getPropertiesWithPrefix(String prefix)
    • aValueIsDefinedFor

      boolean aValueIsDefinedFor(Enum<?> property)
    • aValueIsDefinedFor

      boolean aValueIsDefinedFor(String property)
    • hasPath

      boolean hasPath(String path)
    • injectSystemPropertiesInto

      String injectSystemPropertiesInto(String value)
    • asMap

      Map<String,String> asMap()
    • simpleSystemPropertiesAsMap

      Map<String,String> simpleSystemPropertiesAsMap()
    • reset

      void reset()
    • setConfig

      void setConfig(com.typesafe.config.Config typesafeConfig)
    • getConfig

      default com.typesafe.config.Config getConfig(String prefix)
    • activeEnvironments

      default List<String> activeEnvironments()
    • properties

      Map<String,String> properties()