Interface KoraConfigModification
- All Known Implementing Classes:
KoraConfigFile,KoraConfigString,KoraConfigSystemProperties
public interface KoraConfigModification
"application.conf" configuration modification for tests with system properties
-
Method Summary
Modifier and TypeMethodDescriptionstatic KoraConfigFileofResourceFile(String configFile) File is located in "resources" directory than example below:KoraConfigModification.ofFile("reference-raw.conf")static KoraConfigStringExample below:KoraConfigModification.ofString(""" myconfig { myinnerconfig { first = 1 } } """)static KoraConfigSystemPropertiesofSystemProperty(String key, String value) Use system property to set `ENV_FIRST` and 'ENV_SECOND'KoraConfigModification.ofSystemProperty("ENV_FIRST", "1") .withSystemProperty("ENV_SECOND", "2");withSystemProperty(String key, String value) Example: Given config below
-
Method Details
-
systemProperties
-
withSystemProperty
Example: Given config belowmyconfig { myinnerconfig { first = ${ENV_FIRST} second = ${ENV_SECOND} } }Use system property to set `ENV_FIRST` and 'ENV_SECOND'KoraConfigModification.ofString(""" myconfig { myinnerconfig { first = ${ENV_FIRST} second = ${ENV_SECOND} } } """) .withSystemProperty("ENV_FIRST", "1") .withSystemProperty("ENV_SECOND", "2");- Parameters:
key- system property keyvalue- system property value- Returns:
- self
-
ofString
Example below:KoraConfigModification.ofString(""" myconfig { myinnerconfig { first = 1 } } """)- Parameters:
config- application configuration with config as string- Returns:
- self
-
ofResourceFile
File is located in "resources" directory than example below:KoraConfigModification.ofFile("reference-raw.conf")- Parameters:
configFile- application configuration with config file from "resources" directory- Returns:
- self
-
ofSystemProperty
@Nonnull static KoraConfigSystemProperties ofSystemProperty(@Nonnull String key, @Nonnull String value) Use system property to set `ENV_FIRST` and 'ENV_SECOND'KoraConfigModification.ofSystemProperty("ENV_FIRST", "1") .withSystemProperty("ENV_SECOND", "2");- Parameters:
key- system property keyvalue- system property value- Returns:
- self
-