Class FlagRule<T>

java.lang.Object
org.junit.rules.ExternalResource
org.jvnet.hudson.test.FlagRule<T>
All Implemented Interfaces:
org.junit.rules.TestRule

public final class FlagRule<T> extends org.junit.rules.ExternalResource
Saves and restores sort of a flag, such as a static field or system property.
  • Constructor Details

  • Method Details

    • before

      protected void before() throws Throwable
      Overrides:
      before in class org.junit.rules.ExternalResource
      Throws:
      Throwable
    • after

      protected void after()
      Overrides:
      after in class org.junit.rules.ExternalResource
    • systemProperty

      public static FlagRule<String> systemProperty(String key)
    • systemProperty

      public static FlagRule<String> systemProperty(String key, String replacement)