IntelliJ IDEA cannot allow static imports

When I import regularly, it works as expected:

enter image description here

However, if I changed the import to static, IDEA will not be able to solve it:

enter image description here

Gradle successfully completes the project.

There seems to be a problem with IDEA, but I cannot find out if this is a known issue. I tried flushing, invalidating caches, etc. Anything else I can do?

Im using IntelliJ IDEA community 2016.2.4and java version1.7.0_79

+5
source share
2 answers

You also want to do this in order to import all the static members of Assert.

import static org.junit.Assert.*;

,

import static org.junit.Assert.assertEquals;
+5

- , . , , org.junit.Assert:

import static org.junit.Assert.*;
+3

Source: https://habr.com/ru/post/1658077/


All Articles