Android Studio automatically erases my static imports in Unit tests

89 Views Asked by At

Android Studio automatically erases my static imports. I started out creating new tests using robolectric and when I used static import for import static junit.framework.Assert.assertEquals; Android-Studio automatically removes it. this is so frustrating.

Is there some settings I need to set this up?

1

There are 1 best solutions below

0
Ryuichi On

Go to Preferences --> Editor --> Code Style --> Java, select "Imports" tab.

You can manage imports there as you see fit. For example, I have some settings in the section "Packages to Use Import with '*'".

Screenshot