Switched to AndroidX and received deprecated: import androidx.test.InstrumentationRegistry.
If I made next import: import androidx.te
I spent a lot of time moving dependency with testImplementation instead of androidTestImplementation and reverse, in the app build.gradle.
My fault was that I have created the test class in the test folder instead of androidTest folder so getting unresolved error for AndroidJuit4 and InstrumentationRegistry.
When I shifted my test file to the androidTest folder then issue been solved with depandency implementation of test libraries with androidTestImplementation in the build.gradle.