
com.github.signed.junit.rule.SystemProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of junit-extras Show documentation
Show all versions of junit-extras Show documentation
junit-extras is a set of small extensions to junit
The newest version!
package com.github.signed.junit.rule;
import org.junit.rules.ExternalResource;
import java.util.Properties;
public class SystemProperties extends ExternalResource {
private Properties original;
private Properties copy = new Properties();
@Override
protected void before() throws Throwable {
original = System.getProperties();
copy.putAll(original);
System.setProperties(copy);
}
@Override
protected void after() {
System.setProperties(original);
}
public void put(String key, String value) {
copy.put(key, value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy