mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 05:13:53 +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
|
|
@ -1,5 +1,7 @@
|
|||
package fr.free.nrw.commons;
|
||||
|
||||
import static fr.free.nrw.commons.TestConnectionFactoryKt.createTestClient;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.AbstractExecutorService;
|
||||
|
|
@ -12,7 +14,6 @@ import org.junit.After;
|
|||
import org.junit.Before;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.wikipedia.AppAdapter;
|
||||
import org.wikipedia.json.GsonUtil;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
|
@ -23,9 +24,9 @@ public abstract class MockWebServerTest {
|
|||
private final TestWebServer server = new TestWebServer();
|
||||
|
||||
@Before public void setUp() throws Throwable {
|
||||
AppAdapter.set(new TestAppAdapter());
|
||||
OkHttpClient.Builder builder = AppAdapter.get().getOkHttpClient().newBuilder();
|
||||
okHttpClient = builder.dispatcher(new Dispatcher(new ImmediateExecutorService())).build();
|
||||
OkHttpConnectionFactory.CLIENT = createTestClient();
|
||||
okHttpClient = OkHttpConnectionFactory.CLIENT.newBuilder()
|
||||
.dispatcher(new Dispatcher(new ImmediateExecutorService())).build();
|
||||
server.setUp();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue