How not to remove static imports in test in Intellij IDea?

There is an Optimize imports on fly option (Editor-> General-> AutoImport) that removes unused imports. But when a test class is created, Intellij's idea adds import static org.junit.Assert.*; to him. But when the file is saved (immediately after adding), it removes this import. Is there a way to set up the Itellij idea to prevent this, but keep Optimize imports on fly enabled?

+7
java import intellij-idea
source share

No one has answered this question yet.

See related questions:

1898
How do you claim that a specific exception is thrown in JUnit 4 tests?
1762
How to import SQL file using command line in MySQL?
1338
How can I consistently include line numbers in IntelliJ?
478
IntelliJ inspection gives "Unable to resolve character" but still compiles code
442
The correct way to add external jars (lib / *. Jar) to an IntelliJ IDEA project
176
Import Maven dependencies into IntelliJ IDEA
75
getting gradle dependencies in intellij IDEA using gradle build
2
IntelliJ organizes import, removes org.hamcrest.CoreMatchers.is
0
Enable static import patterns for some classes in Intellij IDEA
0
How to prevent Intellij Idea from deleting unused imports?

All Articles