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:
Paul Hawke 2024-01-30 19:21:43 -06:00 committed by GitHub
parent ab9e57f5be
commit 8db0b54929
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 422 additions and 518 deletions

View file

@ -8,15 +8,15 @@ import android.os.Looper
import android.view.LayoutInflater
import android.view.View
import android.widget.Button
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import androidx.test.core.app.ApplicationProvider
import fr.free.nrw.commons.CommonsApplication
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.actions.PageEditClient
import fr.free.nrw.commons.feedback.model.Feedback
import fr.free.nrw.commons.kvstore.JsonKvStore
@ -38,7 +38,6 @@ import org.robolectric.annotation.LooperMode
import org.robolectric.shadows.ShadowActivity
import org.robolectric.shadows.ShadowAlertDialog
import org.robolectric.shadows.ShadowDialog
import org.wikipedia.AppAdapter
import java.lang.reflect.Method
@ -63,7 +62,7 @@ class MoreBottomSheetFragmentUnitTests {
fun setUp() {
MockitoAnnotations.openMocks(this)
context = ApplicationProvider.getApplicationContext()
AppAdapter.set(TestAppAdapter())
OkHttpConnectionFactory.CLIENT = createTestClient()
activity = Robolectric.buildActivity(ProfileActivity::class.java).create().get()
fragment = MoreBottomSheetFragment()