Previously, JMockit had a tearDown() method for mocks. In most cases, it makes sense to remove this method. This way mocks have a definite lifetime of a test method, class, suite, etc. I have encountered a situation where I need to create a mock for class initialization but then disable the mock for the rest of the test cases. In my MockUp class, I add a private boolean field and a disable() to turn off the mock. This is cumbersome and requires extra work on my part. Please re-add a tearDown() method so that it is easy to remove a mock that is no longer needed during initialization and hence the mock is not active for the rest of the test cases.
Previously, JMockit had a tearDown() method for mocks. In most cases, it makes sense to remove this method. This way mocks have a definite lifetime of a test method, class, suite, etc. I have encountered a situation where I need to create a mock for class initialization but then disable the mock for the rest of the test cases. In my MockUp class, I add a private boolean field and a disable() to turn off the mock. This is cumbersome and requires extra work on my part. Please re-add a tearDown() method so that it is easy to remove a mock that is no longer needed during initialization and hence the mock is not active for the rest of the test cases.