Seems when I make “move” refactoring all my junit tests lays on its old place. Often I tests “package” visible classes, so they becomes invisible, if SUT moves to another package.
Do you move tests by hand?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have 4 options for you:
Go to the “Package” view in the left, select both files, and then hit F6. It should move them both to the right place.
Make the class public temporarily, before you do your refactor, and switch back afterwards.
Try moving the test first. I seem to remember that avoids breaking any of the dependencies.
There is a plugin (I think it’s toggleTest or unitTest— I had both of them installed) that patches the Move Refactor to also bring the test with it. Worked great. Unfortunately it looks like these may not work with the latest IDEA.