public class SystemPropertyTestListener
extends SystemPropertyListener
Changes System Properties with chosen keys and values
This is a Listener for code that uses System Properties. It changes the specific keys from System.getProperties with the specified values, only during the execution of a test.
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 the test, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the environment while it was already changed, the result is inconsistent, as the System Properties Map is a single map.
| Constructor and Description |
|---|
SystemPropertyTestListener(java.util.Map<java.lang.String,java.lang.String> newProperties,
OverrideMode mode)
Changes System Properties with chosen keys and values
|
SystemPropertyTestListener(java.util.List<kotlin.Pair> listOfPairs,
OverrideMode mode)
Changes System Properties with chosen keys and values
|
SystemPropertyTestListener(java.lang.String key,
java.lang.String value,
OverrideMode mode)
Changes System Properties with chosen keys and values
|
SystemPropertyTestListener(java.util.Properties properties,
OverrideMode mode)
Changes System Properties with chosen keys and values
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterTest(io.kotlintest.TestCase testCase,
io.kotlintest.TestResult result) |
void |
beforeTest(io.kotlintest.TestCase testCase) |
changeSystemProperties, resetSystemPropertiespublic SystemPropertyTestListener(java.util.Map<java.lang.String,java.lang.String> newProperties,
OverrideMode mode)
Changes System Properties with chosen keys and values
This is a Listener for code that uses System Properties. It changes the specific keys from System.getProperties with the specified values, only during the execution of a test.
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 the test, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the environment while it was already changed, the result is inconsistent, as the System Properties Map is a single map.
public SystemPropertyTestListener(java.util.List<kotlin.Pair> listOfPairs,
OverrideMode mode)
Changes System Properties with chosen keys and values
This is a Listener for code that uses System Properties. It changes the specific keys from System.getProperties with the specified values, only during the execution of a test.
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 the test, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the environment while it was already changed, the result is inconsistent, as the System Properties Map is a single map.
public SystemPropertyTestListener(java.lang.String key,
java.lang.String value,
OverrideMode mode)
Changes System Properties with chosen keys and values
This is a Listener for code that uses System Properties. It changes the specific keys from System.getProperties with the specified values, only during the execution of a test.
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 the test, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the environment while it was already changed, the result is inconsistent, as the System Properties Map is a single map.
public SystemPropertyTestListener(java.util.Properties properties,
OverrideMode mode)
Changes System Properties with chosen keys and values
This is a Listener for code that uses System Properties. It changes the specific keys from System.getProperties with the specified values, only during the execution of a test.
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 the test, the properties are set to what they were before.
ATTENTION: This code is susceptible to race conditions. If you attempt to change the environment while it was already changed, the result is inconsistent, as the System Properties Map is a single map.