Does assertTrue statement require static import in intelliJ IDEA?

I just changed my Netbeans design form to intelliJ IDEA, my junit based test project. In netbeans I used entries

assertTrue("Message", conditionCustom());

and he worked without additional import. Now when using the same command in intelliJ I need to import the file

import static org.junit.Assert.assertTrue;

Is there a way, so I don't need to write the above line in my code file? otherwise, I have to edit all my files to get the assertTrue instruction.

+5
source share
1 answer

You either need to add a static import, or indicate which class the static call is associated with:

Assert.assertTrue("Message", conditionCustom());

I usually use the latter because I think it is clearer.

Java , , .

, , , , .

+14

All Articles