mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-01 15:23:54 +01:00
Remove the data-client app adapter implementation (#5499)
* logErrorsInsteadOfCrashing only ever returned false, so remove it and simplify logger * Removed unused getMediaWikiBaseUrl() * Removed getDesiredLeadImageDp() from commons app adapter, since it's unused * Inlined the isLoggedIn() method of the app adapter * Inline the app adapter username/password * Removed the unused getRestbaseUriFormat() from the commons app adapter * Remove references to the data-client SharedPreferenceCookieManager * Manage our own OkHttpClient and remove the AppAdapter implementation
This commit is contained in:
parent
ab9e57f5be
commit
8db0b54929
57 changed files with 422 additions and 518 deletions
|
|
@ -10,9 +10,10 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.test.core.app.ApplicationProvider
|
||||
import fr.free.nrw.commons.OkHttpConnectionFactory
|
||||
import fr.free.nrw.commons.R
|
||||
import fr.free.nrw.commons.TestAppAdapter
|
||||
import fr.free.nrw.commons.TestCommonsApplication
|
||||
import fr.free.nrw.commons.createTestClient
|
||||
import fr.free.nrw.commons.auth.login.LoginResult
|
||||
import fr.free.nrw.commons.kvstore.JsonKvStore
|
||||
import org.junit.Assert
|
||||
|
|
@ -27,7 +28,6 @@ import org.robolectric.Robolectric
|
|||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
import org.robolectric.fakes.RoboMenuItem
|
||||
import org.wikipedia.AppAdapter
|
||||
import java.lang.reflect.Method
|
||||
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ class LoginActivityUnitTests {
|
|||
@Before
|
||||
fun setUp() {
|
||||
MockitoAnnotations.openMocks(this)
|
||||
AppAdapter.set(TestAppAdapter())
|
||||
OkHttpConnectionFactory.CLIENT = createTestClient()
|
||||
activity = Robolectric.buildActivity(LoginActivity::class.java).create().get()
|
||||
context = ApplicationProvider.getApplicationContext()
|
||||
menuItem = RoboMenuItem(null)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ class CsrfTokenClientTest : MockWebServerTest() {
|
|||
private val sessionManager = mock(SessionManager::class.java)
|
||||
private val tokenInterface = mock(CsrfTokenInterface::class.java)
|
||||
private val loginClient = mock(LoginClient::class.java)
|
||||
private val subject = CsrfTokenClient(sessionManager, tokenInterface, loginClient)
|
||||
private val logoutClient = mock(LogoutClient::class.java)
|
||||
private val subject = CsrfTokenClient(sessionManager, tokenInterface, loginClient, logoutClient)
|
||||
|
||||
@Test
|
||||
@Throws(Throwable::class)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue