Code - before:
import org.junit.Assert;
...
Assert.assertEquals(a,b);
Assert.assertEquals(c,d);
Steps:
I remove the first Assert.
:
assertEquals(a,b);
Assert.assertEquals(c,d);
Now the first assertEquals
is red.
Now I click on the first assertEquals
and I hit Alt + Enter
I select "Static import method..." and I see the following popup:
If I click on the last line (the blue line) all lines containing Assert.assertEquals...
become assertEquals...
.
Code - after:
import static org.junit.Assert.assertEquals;
...
assertEquals(a,b);
assertEquals(c,d);
Questions
Is it possible to change the order in the "Class to Import" window? I always want to see the blue line (org.junit
) in the first place.
Or is it possible to remove the other options? For every assert
I want to use org.junit.Assert
.
Details:
You can go to File -> Settings... (Ctrl + Alt + S) -> Editor -> General -> Auto Import and add packages to Exclude from Import and Completion that you don't want to see.