'Intelijj Idea move Junit tests to new class while refactoring
I have a class A with code and class ATest with tests: testcase1, testcase2... . I added new code to A and new testcaseN to ATest. During refactoring, I observed that class A is to big and could be split into two separate classes: A and B. Some test cases should be moved from ATest to newly created BTest.
Is there any method to do this automatically in Intellij to move selected methods and change access to remaining ATest class properties and help methods?
Solution 1:[1]
You can place the cursor on the method name, that you wish to move. Then select Refactor -> Move instance method.... There will be a wizard on what to do next for related instances, helper methods...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vinh Truong |
