Class SystemPropertiesRule
java.lang.Object
uk.org.webcompere.systemstubs.resource.SingularTestResource
uk.org.webcompere.systemstubs.properties.SystemProperties
uk.org.webcompere.systemstubs.rules.SystemPropertiesRule
- All Implemented Interfaces:
org.junit.rules.TestRule,Executable,NameValuePairSetter<SystemProperties>,TestResource,SystemStubTestRule
Returns the system properties to their original state around each test block. Provides
the ability for properties to be prepared before the test starts, via
set(java.lang.String, java.lang.String).- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor provides restoration of propertiesSystemPropertiesRule(String name, String value, String... nameValues) Construct with a variable number of properties that will be set when the rule is activeSystemPropertiesRule(Properties properties) Construct with some properties to apply when active -
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from class uk.org.webcompere.systemstubs.properties.SystemProperties
doSetup, doTeardownMethods inherited from class uk.org.webcompere.systemstubs.resource.SingularTestResource
isActive, setup, teardownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.org.webcompere.systemstubs.resource.Executable
executeMethods inherited from interface uk.org.webcompere.systemstubs.resource.NameValuePairSetter
setMethods inherited from interface uk.org.webcompere.systemstubs.rules.internal.SystemStubTestRule
applyMethods inherited from interface uk.org.webcompere.systemstubs.resource.TestResource
execute, setup, teardown
-
Constructor Details
-
SystemPropertiesRule
public SystemPropertiesRule()Default constructor provides restoration of properties -
SystemPropertiesRule
Construct with some properties to apply when active- Parameters:
properties- system properties to apply when active
-
SystemPropertiesRule
Construct with a variable number of properties that will be set when the rule is active- Parameters:
name- name of the first propertyvalue- value of the first propertynameValues- pairs of name/values as Strings
-
-
Method Details
-
set
- Specified by:
setin interfaceNameValuePairSetter<SystemProperties>- Overrides:
setin classSystemProperties
-
set
- Specified by:
setin interfaceNameValuePairSetter<SystemProperties>
-