I think the solution for yout would be to mock the value that test1 sets.
Ideally, the tests should be independent, so try to make fun of this value so you can always run test2 whenever you want, and you should also simulate (mock) dirty values ββso you can see how test2 works if it receives unexpected data .
Juan Antonio Gomez Moriano
source share