Class SystemPropertiesRule

All Implemented Interfaces:
org.junit.rules.TestRule, Executable, NameValuePairSetter<SystemPropertiesRule>, TestResource, SystemStubTestRule

public class SystemPropertiesRule extends SystemPropertiesImpl<SystemPropertiesRule> implements 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 SystemPropertiesImpl.set(java.lang.String, java.lang.String).
Since:
1.0.0
  • Constructor Details

    • SystemPropertiesRule

      public SystemPropertiesRule()
      Default constructor provides restoration of properties
    • SystemPropertiesRule

      public SystemPropertiesRule(Properties properties)
      Construct with some properties to apply when active
      Parameters:
      properties - system properties to apply when active
    • SystemPropertiesRule

      public SystemPropertiesRule(String name, String value, String... nameValues)