It is sometimes useful to have RestoreSystemProperties abilities at a class level. System properties should be restored to the state before the first @BeforeClass method after all tests and all @AfterClass methods are executed.
Simple use case. Testing logic related to system properties inside a Spring context which is created in @BeforeClass method.
It would be important to have support for putting the rule in a super class extended by many test specifications.
I don't know JUnit internals and I am not sure if the same rule can work on both test/method and class level or a new rule would have to be created.
It is sometimes useful to have RestoreSystemProperties abilities at a class level. System properties should be restored to the state before the first @BeforeClass method after all tests and all @AfterClass methods are executed.
Simple use case. Testing logic related to system properties inside a Spring context which is created in @BeforeClass method.
It would be important to have support for putting the rule in a super class extended by many test specifications.
I don't know JUnit internals and I am not sure if the same rule can work on both test/method and class level or a new rule would have to be created.