Class SystemPropertiesRestoreRule

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    public class SystemPropertiesRestoreRule
    extends Object
    implements org.junit.rules.TestRule
    Restore system properties from before the nested Statement.
    • Constructor Detail

      • SystemPropertiesRestoreRule

        public SystemPropertiesRestoreRule()
        Restores all properties.
      • SystemPropertiesRestoreRule

        public SystemPropertiesRestoreRule​(Set<String> ignoredProperties)
        Parameters:
        ignoredProperties - Properties that will be ignored (and will not be restored).
      • SystemPropertiesRestoreRule

        public SystemPropertiesRestoreRule​(String... ignoredProperties)
        Parameters:
        ignoredProperties - Properties that will be ignored (and will not be restored).
    • Method Detail

      • apply

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