inline fun <T> withSystemProperties(pair: Pair<String, String?>, mode: OverrideMode = SetOrError, block: () -> T): T
Changes System Properties with chosen key and value
This is a helper function for code that uses System Properties. It changes the specific key from System.getProperties with the specified value, only during the execution of block.
If the chosen key is in the properties, it will be changed according to mode. If the chosen key is not in the properties, it will be included.
After the execution of block, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the properties while it was already changed, the result is inconsistent, as the System Properties Map is a single map.
inline fun <T> withSystemProperties(props: Properties, mode: OverrideMode = SetOrError, block: () -> T): T
Changes System Properties with chosen properties
This is a helper function for code that uses System Properties. It changes the specific keys from System.getProperties with the specified values, only during the execution of block.
If the chosen key is in the properties, it will be changed according to mode. If the chosen key is not in the properties, it will be included.
After the execution of block, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the properties while it was already changed, the result is inconsistent, as the System Properties Map is a single map.
inline fun <T> withSystemProperties(props: Map<String, String?>, mode: OverrideMode = SetOrError, block: () -> T): T
Changes System Properties with chosen keys and values
This is a helper function for code that uses System Properties. It changes the specific key from System.getProperties with the specified value, only during the execution of block.
If the chosen key is in the properties, it will be changed according to mode. If the chosen key is not in the properties, it will be included.
After the execution of block, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the properties while it was already changed, the result is inconsistent, as the System Properties Map is a single map.