Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move Unit Test classes automatically in Intellij Idea?

Is there any way, how to make Intellij Idea to move my Unit Test classes automatically to a coresponding package when I move tested class?

For example I have these two classes:

src/main/java/com/MyClass.java
src/test/java/com/MyClassTest.java

When I move

src/main/java/com/MyClass.java

to

src/main/java/com/subpackage/MyClass.java

I need the test class to be moved automatically like this:

src/test/java/com/subpackage/MyClassTest.java

It is the same functionality, that does MoreUnit Eclipse plugin.

like image 952
Michal Krasny Avatar asked Oct 23 '15 10:10

Michal Krasny


1 Answers

Intellij Idea does not support this so far.

You can vote here for a new idea to make this feature happen. https://youtrack.jetbrains.com/issue/IDEA-20779#tab=Comments&u=1481384491786

Edit 2018: Intellij Idea now contains this functionality.

Edit 2018-08: It seems that it does not work anymore or it never worked and I just thought it worked.

like image 81
Michal Krasny Avatar answered Sep 18 '22 15:09

Michal Krasny