mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
4671: Change the deprecated RuntimeEnvironment.application in all the Robolectric unit tests (#5140)
* Robolectric Unit Tests: change deprecated robolectric RuntimeEnvironment.application to ApplicationProvider and optimise imports * Delete app/CommonsContributions directory Removed unnecessary directory created in the process
This commit is contained in:
parent
87f637f5c6
commit
1bc21c2629
60 changed files with 140 additions and 157 deletions
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||
import android.net.Uri
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import androidx.test.core.app.ApplicationProvider
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
|
|
@ -11,7 +12,6 @@ import org.junit.runner.RunWith
|
|||
import org.mockito.MockitoAnnotations
|
||||
import org.robolectric.Robolectric
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.Shadows
|
||||
import org.robolectric.annotation.Config
|
||||
import org.robolectric.fakes.RoboMenu
|
||||
|
|
@ -33,7 +33,7 @@ class AboutActivityUnitTests {
|
|||
|
||||
activity = Robolectric.buildActivity(AboutActivity::class.java).create().get()
|
||||
|
||||
context = RuntimeEnvironment.application.applicationContext
|
||||
context = ApplicationProvider.getApplicationContext()
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue