You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in [1]:
> JUnit creates a new instance of the test class before invoking each
> @test method. This helps provide independence between test methods and
> avoids unintentional side effects in the test code. Because each test
> method runs on a new test class instance, we can’t reuse instance
> variable values across test methods.
Each `@Test` method would create a new instance of the test classes,
which means each `@Test` method would create N new processes.
[1]: https://stackoverflow.com/questions/14010222/junit-new-instance-before-invoking-each-test-method-what-are-the-benefits
0 commit comments