I made several tests(about 20) and the problem I keep having is that some private variables with no getters or setters inside my application are being altered during my tests. What I want is that each test has the default variables as if the application just started running(as if the second test is the first test). I want this because I dont want that the second test is dependent of the outcome of the first test...
I know about setup and teardown. But I cant use it because I dont have setters and getters to those variables and I dont want to change my beans just to make my tests independent of eachother
Without knowing more it's difficult to help. If you need to re-instantiate the classes in question then do do, or design the application and/or class hierarchy in such a way that you can change the variables you need to.
You might be able to use reflection, but it'd be substantially cleaner to just create a testable app.