Class SetSystemPropertyRule

java.lang.Object
org.robolectric.junit.rules.SetSystemPropertyRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class SetSystemPropertyRule extends Object implements org.junit.rules.TestRule
A rule that lets you override system properties for tests. All properties are restored after each test.
  • Constructor Details

    • SetSystemPropertyRule

      public SetSystemPropertyRule()
  • Method Details

    • set

      public void set(String key, String value)
    • clear

      public void clear(String key)
    • apply

      public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
      Specified by:
      apply in interface org.junit.rules.TestRule