mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Merge branch 'master' into show-block-status
This commit is contained in:
commit
c0d86b76e8
144 changed files with 1867 additions and 1005 deletions
|
|
@ -4,6 +4,7 @@ import android.content.ContentProviderClient
|
|||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.support.v4.util.LruCache
|
||||
import com.google.gson.Gson
|
||||
import com.nhaarman.mockito_kotlin.mock
|
||||
import com.squareup.leakcanary.RefWatcher
|
||||
import fr.free.nrw.commons.auth.AccountUtil
|
||||
|
|
@ -37,6 +38,7 @@ class MockCommonsApplicationModule(appContext: Context) : CommonsApplicationModu
|
|||
val accountUtil: AccountUtil = mock()
|
||||
val appSharedPreferences: SharedPreferences = mock()
|
||||
val defaultSharedPreferences: SharedPreferences = mock()
|
||||
val categorySharedPreferences: SharedPreferences = mock()
|
||||
val otherSharedPreferences: SharedPreferences = mock()
|
||||
val uploadController: UploadController = mock()
|
||||
val mockSessionManager: SessionManager = mock()
|
||||
|
|
@ -44,6 +46,7 @@ class MockCommonsApplicationModule(appContext: Context) : CommonsApplicationModu
|
|||
val mockDbOpenHelper: DBOpenHelper = mock()
|
||||
val nearbyPlaces: NearbyPlaces = mock()
|
||||
val lruCache: LruCache<String, String> = mock()
|
||||
val gson: Gson = Gson()
|
||||
val categoryClient: ContentProviderClient = mock()
|
||||
val contributionClient: ContentProviderClient = mock()
|
||||
val modificationClient: ContentProviderClient = mock()
|
||||
|
|
|
|||
|
|
@ -27,15 +27,17 @@ class ApacheHttpClientMediaWikiApiTest {
|
|||
|
||||
private lateinit var testObject: ApacheHttpClientMediaWikiApi
|
||||
private lateinit var server: MockWebServer
|
||||
private lateinit var wikidataServer: MockWebServer
|
||||
private lateinit var sharedPreferences: SharedPreferences
|
||||
private lateinit var categoryPreferences: SharedPreferences
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
server = MockWebServer()
|
||||
wikidataServer = MockWebServer()
|
||||
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(RuntimeEnvironment.application)
|
||||
categoryPreferences = PreferenceManager.getDefaultSharedPreferences(RuntimeEnvironment.application)
|
||||
testObject = ApacheHttpClientMediaWikiApi(RuntimeEnvironment.application, "http://" + server.hostName + ":" + server.port + "/", sharedPreferences, categoryPreferences, Gson())
|
||||
testObject = ApacheHttpClientMediaWikiApi(RuntimeEnvironment.application, "http://" + server.hostName + ":" + server.port + "/", "http://" + wikidataServer.hostName + ":" + wikidataServer.port + "/", sharedPreferences, categoryPreferences, Gson())
|
||||
testObject.setWikiMediaToolforgeUrl("http://" + server.hostName + ":" + server.port + "/")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue