Stefan Birkner
Stefan Birkner
I think the problem is that `Shared_secret` is static. Therefore `System.getenv("SHAREDSECRET")` is only called once. I have one possible explanation for your problem. Let class A be the class with...
I have plans for a Java 8 version of this library that does not need JUnit rules. Which version of Java do you use?
It will. Unfortunately it will not be as easy to use as the rules and TestNG is does not have any extension points like rules. (http://stackoverflow.com/questions/6099633/does-testng-support-something-like-junit4s-rule)
Which rule are you looking for foremost?
I keep you updated on the progress of the new library. Hopefully I can provide a first release for testing `System.exti()` in the next few days.
Would this work for you: ``` java @Test public void test() { int statusCode = catchSystemExit(() -> { //here comes your code that calls System.exit(...) }); assertEquals(0, statusCode); } ```
I started to create a library called [System Lambda](https://github.com/stefanbirkner/system-lambda) that solves the same testing problems like System Rules but without a dependency to a test framework. If that solves your...
Could you provide a pull request that fixes the issue? That would be very helpful.
Thanks for the pull request. I cannot review it the next two weeks, but I review it afterwards.
Relating Stack Overflow question: http://stackoverflow.com/questions/32584997/setting-a-custom-security-manager-when-running-junit-with-gradle