From 6bf456ab0739d0ffd7e67103402fc03d9d0323da Mon Sep 17 00:00:00 2001 From: jcqli <40325757+jcqli@users.noreply.github.com> Date: Thu, 25 Mar 2021 16:48:55 -0700 Subject: [PATCH] Fix #2967 Refactor packages for services (#2970) * Move mocks and api util to testing module * Remove completed explorations from data class * Update fake JSON * Add data objects for entry point * Fix packages for services * Fix JSON & data class to match * Fix test package names & imports * Revert "Remove completed explorations from data class" This reverts commit 9c1b800f21d807d48a47ea8d05ed3358a3a76007. * Revert "Update fake JSON" This reverts commit ea0847a43a318812d6d3e33af90255de1aa87c2d. * Revert "Add data objects for entry point" This reverts commit 445e320bae49f29b5c1308513fe29ae75572a16d. * Revert "Fix JSON & data class to match" This reverts commit c9c07521ca9ad7da6dc215a510be4a73c7ee4aef. * Remove extra data object changes * Remove entry point data object * Undo persistent cache store test change * Move api utils to testing/network package --- .../assets/api_mocks/feedback_reporting.json | 28 ++++++++++++------- .../{test => gae}/NetworkInterceptorTest.kt | 8 ++---- .../api/ClassroomServiceTest.kt} | 7 ++--- .../api/ConceptCardServiceTest.kt} | 7 ++--- .../api/ExplorationServiceTest.kt} | 7 ++--- .../api/FeedbackReportingServiceTest.kt} | 9 +++--- .../api/QuestionPlayerServiceTest.kt} | 7 ++--- .../api/StoryServiceTest.kt} | 7 ++--- .../api/SubtopicServiceTest.kt} | 7 ++--- .../api/TopicServiceTest.kt} | 7 ++--- .../android/testing/network}/ApiUtils.kt | 2 +- .../testing/network}/MockClassroomService.kt | 3 +- .../network}/MockConceptCardService.kt | 3 +- .../network}/MockExplorationService.kt | 3 +- .../network}/MockFeedbackReportingService.kt | 4 +-- .../network}/MockQuestionPlayerService.kt | 3 +- .../testing/network}/MockStoryService.kt | 3 +- .../testing/network}/MockSubtopicService.kt | 3 +- .../testing/network}/MockTopicService.kt | 3 +- 19 files changed, 56 insertions(+), 65 deletions(-) rename data/src/test/java/org/oppia/android/data/backends/{test => gae}/NetworkInterceptorTest.kt (90%) rename data/src/test/java/org/oppia/android/data/backends/{test/MockClassroomTest.kt => gae/api/ClassroomServiceTest.kt} (89%) rename data/src/test/java/org/oppia/android/data/backends/{test/MockConceptCardTest.kt => gae/api/ConceptCardServiceTest.kt} (90%) rename data/src/test/java/org/oppia/android/data/backends/{test/MockExplorationTest.kt => gae/api/ExplorationServiceTest.kt} (89%) rename data/src/test/java/org/oppia/android/data/backends/{test/MockFeedbackReportingTest.kt => gae/api/FeedbackReportingServiceTest.kt} (89%) rename data/src/test/java/org/oppia/android/data/backends/{test/MockQuestionPlayerTest.kt => gae/api/QuestionPlayerServiceTest.kt} (90%) rename data/src/test/java/org/oppia/android/data/backends/{test/MockStoryTest.kt => gae/api/StoryServiceTest.kt} (89%) rename data/src/test/java/org/oppia/android/data/backends/{test/MockSubtopicTest.kt => gae/api/SubtopicServiceTest.kt} (89%) rename data/src/test/java/org/oppia/android/data/backends/{test/MockTopicTest.kt => gae/api/TopicServiceTest.kt} (89%) rename {data/src/test/java/org/oppia/android/data/backends => testing/src/main/java/org/oppia/android/testing/network}/ApiUtils.kt (93%) rename {data/src/test/java/org/oppia/android/data/backends/api => testing/src/main/java/org/oppia/android/testing/network}/MockClassroomService.kt (94%) rename {data/src/test/java/org/oppia/android/data/backends/api => testing/src/main/java/org/oppia/android/testing/network}/MockConceptCardService.kt (94%) rename {data/src/test/java/org/oppia/android/data/backends/api => testing/src/main/java/org/oppia/android/testing/network}/MockExplorationService.kt (94%) rename {data/src/test/java/org/oppia/android/data/backends/api => testing/src/main/java/org/oppia/android/testing/network}/MockFeedbackReportingService.kt (79%) rename {data/src/test/java/org/oppia/android/data/backends/api => testing/src/main/java/org/oppia/android/testing/network}/MockQuestionPlayerService.kt (94%) rename {data/src/test/java/org/oppia/android/data/backends/api => testing/src/main/java/org/oppia/android/testing/network}/MockStoryService.kt (93%) rename {data/src/test/java/org/oppia/android/data/backends/api => testing/src/main/java/org/oppia/android/testing/network}/MockSubtopicService.kt (94%) rename {data/src/test/java/org/oppia/android/data/backends/api => testing/src/main/java/org/oppia/android/testing/network}/MockTopicService.kt (93%) diff --git a/data/src/test/assets/api_mocks/feedback_reporting.json b/data/src/test/assets/api_mocks/feedback_reporting.json index bc3f3e5ea98..3d0796deecd 100644 --- a/data/src/test/assets/api_mocks/feedback_reporting.json +++ b/data/src/test/assets/api_mocks/feedback_reporting.json @@ -1,36 +1,44 @@ { - "api_key": "", "app_context": { "entry_point": "navigation_drawer", + "completed_exploration_ids": [ + 0, + 1 + ], "topic_progress": {}, "text_size": "large", "text_lang": "EN", "audio_lang": "EN", "download_and_update_only_on_wifi": true, "automatically_update_topics": false, - "is_admin": false + "is_admin": false, + "event_logs": [ + "example", + "event" + ], + "logcat_logs": [ + "example", + "log" + ] }, "device_context": { "device_model": "example_model", "sdk_version": 23, "device_brand": "example_brand", "build_fingerprint": "example_fingerprint_id", - "phone_type": "telephony_network_type", - "network_type": "wifi", - "device_lang": "EN" + "network_type": "wifi" }, - "report_creation_timestamp": 1610519337000, + "report_creation_timestamp_ms": 1610519337000, "system_context": { - "package_name": "example.package.name", - "package_code": "example_version_code", + "version_name": "0.1-alpha-abcdef1234", + "package_version_code": 1, "country_locale": "IN", "language_locale": "EN" }, - "user_feedback": { + "user_supplied_feedback": { "report_type": "suggestion", "category": "language_suggestion", "feedback_list": [], "user_input": "french" } - } diff --git a/data/src/test/java/org/oppia/android/data/backends/test/NetworkInterceptorTest.kt b/data/src/test/java/org/oppia/android/data/backends/gae/NetworkInterceptorTest.kt similarity index 90% rename from data/src/test/java/org/oppia/android/data/backends/test/NetworkInterceptorTest.kt rename to data/src/test/java/org/oppia/android/data/backends/gae/NetworkInterceptorTest.kt index f4b99965c64..e3d4060fd43 100755 --- a/data/src/test/java/org/oppia/android/data/backends/test/NetworkInterceptorTest.kt +++ b/data/src/test/java/org/oppia/android/data/backends/gae/NetworkInterceptorTest.kt @@ -1,4 +1,4 @@ -package org.oppia.android.data.backends.test +package org.oppia.android.data.backends.gae import android.app.Application import androidx.test.core.app.ApplicationProvider @@ -11,10 +11,8 @@ import dagger.Provides import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.oppia.android.data.backends.ApiUtils -import org.oppia.android.data.backends.api.MockTopicService -import org.oppia.android.data.backends.gae.NetworkInterceptor -import org.oppia.android.data.backends.gae.NetworkModule +import org.oppia.android.testing.network.ApiUtils +import org.oppia.android.testing.network.MockTopicService import org.robolectric.annotation.LooperMode import retrofit2.Retrofit import javax.inject.Inject diff --git a/data/src/test/java/org/oppia/android/data/backends/test/MockClassroomTest.kt b/data/src/test/java/org/oppia/android/data/backends/gae/api/ClassroomServiceTest.kt similarity index 89% rename from data/src/test/java/org/oppia/android/data/backends/test/MockClassroomTest.kt rename to data/src/test/java/org/oppia/android/data/backends/gae/api/ClassroomServiceTest.kt index ec920ac69b3..867db33e43c 100755 --- a/data/src/test/java/org/oppia/android/data/backends/test/MockClassroomTest.kt +++ b/data/src/test/java/org/oppia/android/data/backends/gae/api/ClassroomServiceTest.kt @@ -1,4 +1,4 @@ -package org.oppia.android.data.backends.test +package org.oppia.android.data.backends.gae.api import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat @@ -6,10 +6,9 @@ import okhttp3.OkHttpClient import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.oppia.android.data.backends.api.MockClassroomService import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings -import org.oppia.android.data.backends.gae.api.ClassroomService +import org.oppia.android.testing.network.MockClassroomService import org.robolectric.annotation.LooperMode import retrofit2.Retrofit import retrofit2.converter.moshi.MoshiConverterFactory @@ -21,7 +20,7 @@ import retrofit2.mock.NetworkBehavior */ @RunWith(AndroidJUnit4::class) @LooperMode(LooperMode.Mode.PAUSED) -class MockClassroomTest { +class ClassroomServiceTest { private lateinit var mockRetrofit: MockRetrofit private lateinit var retrofit: Retrofit diff --git a/data/src/test/java/org/oppia/android/data/backends/test/MockConceptCardTest.kt b/data/src/test/java/org/oppia/android/data/backends/gae/api/ConceptCardServiceTest.kt similarity index 90% rename from data/src/test/java/org/oppia/android/data/backends/test/MockConceptCardTest.kt rename to data/src/test/java/org/oppia/android/data/backends/gae/api/ConceptCardServiceTest.kt index 8b5a4607eae..a1daa885283 100755 --- a/data/src/test/java/org/oppia/android/data/backends/test/MockConceptCardTest.kt +++ b/data/src/test/java/org/oppia/android/data/backends/gae/api/ConceptCardServiceTest.kt @@ -1,4 +1,4 @@ -package org.oppia.android.data.backends.test +package org.oppia.android.data.backends.gae.api import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat @@ -6,10 +6,9 @@ import okhttp3.OkHttpClient import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.oppia.android.data.backends.api.MockConceptCardService import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings -import org.oppia.android.data.backends.gae.api.ConceptCardService +import org.oppia.android.testing.network.MockConceptCardService import org.robolectric.annotation.LooperMode import retrofit2.Retrofit import retrofit2.converter.moshi.MoshiConverterFactory @@ -21,7 +20,7 @@ import retrofit2.mock.NetworkBehavior */ @RunWith(AndroidJUnit4::class) @LooperMode(LooperMode.Mode.PAUSED) -class MockConceptCardTest { +class ConceptCardServiceTest { private lateinit var mockRetrofit: MockRetrofit private lateinit var retrofit: Retrofit diff --git a/data/src/test/java/org/oppia/android/data/backends/test/MockExplorationTest.kt b/data/src/test/java/org/oppia/android/data/backends/gae/api/ExplorationServiceTest.kt similarity index 89% rename from data/src/test/java/org/oppia/android/data/backends/test/MockExplorationTest.kt rename to data/src/test/java/org/oppia/android/data/backends/gae/api/ExplorationServiceTest.kt index d57b4781aab..81b3802bd91 100755 --- a/data/src/test/java/org/oppia/android/data/backends/test/MockExplorationTest.kt +++ b/data/src/test/java/org/oppia/android/data/backends/gae/api/ExplorationServiceTest.kt @@ -1,4 +1,4 @@ -package org.oppia.android.data.backends.test +package org.oppia.android.data.backends.gae.api import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat @@ -6,10 +6,9 @@ import okhttp3.OkHttpClient import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.oppia.android.data.backends.api.MockExplorationService import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings -import org.oppia.android.data.backends.gae.api.ExplorationService +import org.oppia.android.testing.network.MockExplorationService import org.robolectric.annotation.LooperMode import retrofit2.Retrofit import retrofit2.converter.moshi.MoshiConverterFactory @@ -21,7 +20,7 @@ import retrofit2.mock.NetworkBehavior */ @RunWith(AndroidJUnit4::class) @LooperMode(LooperMode.Mode.PAUSED) -class MockExplorationTest { +class ExplorationServiceTest { private lateinit var mockRetrofit: MockRetrofit private lateinit var retrofit: Retrofit diff --git a/data/src/test/java/org/oppia/android/data/backends/test/MockFeedbackReportingTest.kt b/data/src/test/java/org/oppia/android/data/backends/gae/api/FeedbackReportingServiceTest.kt similarity index 89% rename from data/src/test/java/org/oppia/android/data/backends/test/MockFeedbackReportingTest.kt rename to data/src/test/java/org/oppia/android/data/backends/gae/api/FeedbackReportingServiceTest.kt index f6603bb6013..5953ff32b58 100644 --- a/data/src/test/java/org/oppia/android/data/backends/test/MockFeedbackReportingTest.kt +++ b/data/src/test/java/org/oppia/android/data/backends/gae/api/FeedbackReportingServiceTest.kt @@ -1,4 +1,4 @@ -package org.oppia.android.data.backends.test +package org.oppia.android.data.backends.gae.api import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat @@ -8,12 +8,11 @@ import okhttp3.OkHttpClient import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.oppia.android.data.backends.ApiUtils -import org.oppia.android.data.backends.api.MockFeedbackReportingService import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings -import org.oppia.android.data.backends.gae.api.FeedbackReportingService import org.oppia.android.data.backends.gae.model.GaeFeedbackReport +import org.oppia.android.testing.network.ApiUtils +import org.oppia.android.testing.network.MockFeedbackReportingService import org.robolectric.annotation.LooperMode import retrofit2.Retrofit import retrofit2.converter.moshi.MoshiConverterFactory @@ -23,7 +22,7 @@ import retrofit2.mock.NetworkBehavior /** Test for [FeedbackReportingService] retrofit instance using a [MockFeedbackReportingService]. */ @RunWith(AndroidJUnit4::class) @LooperMode(LooperMode.Mode.PAUSED) -class MockFeedbackReportingTest { +class FeedbackReportingServiceTest { private lateinit var mockRetrofit: MockRetrofit private lateinit var retrofit: Retrofit diff --git a/data/src/test/java/org/oppia/android/data/backends/test/MockQuestionPlayerTest.kt b/data/src/test/java/org/oppia/android/data/backends/gae/api/QuestionPlayerServiceTest.kt similarity index 90% rename from data/src/test/java/org/oppia/android/data/backends/test/MockQuestionPlayerTest.kt rename to data/src/test/java/org/oppia/android/data/backends/gae/api/QuestionPlayerServiceTest.kt index 028cfaec51e..f847ab955d8 100755 --- a/data/src/test/java/org/oppia/android/data/backends/test/MockQuestionPlayerTest.kt +++ b/data/src/test/java/org/oppia/android/data/backends/gae/api/QuestionPlayerServiceTest.kt @@ -1,4 +1,4 @@ -package org.oppia.android.data.backends.test +package org.oppia.android.data.backends.gae.api import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat @@ -6,10 +6,9 @@ import okhttp3.OkHttpClient import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.oppia.android.data.backends.api.MockQuestionPlayerService import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings -import org.oppia.android.data.backends.gae.api.QuestionPlayerService +import org.oppia.android.testing.network.MockQuestionPlayerService import org.robolectric.annotation.LooperMode import retrofit2.Retrofit import retrofit2.converter.moshi.MoshiConverterFactory @@ -21,7 +20,7 @@ import retrofit2.mock.NetworkBehavior */ @RunWith(AndroidJUnit4::class) @LooperMode(LooperMode.Mode.PAUSED) -class MockQuestionPlayerTest { +class QuestionPlayerServiceTest { private lateinit var mockRetrofit: MockRetrofit private lateinit var retrofit: Retrofit diff --git a/data/src/test/java/org/oppia/android/data/backends/test/MockStoryTest.kt b/data/src/test/java/org/oppia/android/data/backends/gae/api/StoryServiceTest.kt similarity index 89% rename from data/src/test/java/org/oppia/android/data/backends/test/MockStoryTest.kt rename to data/src/test/java/org/oppia/android/data/backends/gae/api/StoryServiceTest.kt index 944036cf935..2b7847415d7 100755 --- a/data/src/test/java/org/oppia/android/data/backends/test/MockStoryTest.kt +++ b/data/src/test/java/org/oppia/android/data/backends/gae/api/StoryServiceTest.kt @@ -1,4 +1,4 @@ -package org.oppia.android.data.backends.test +package org.oppia.android.data.backends.gae.api import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat @@ -6,10 +6,9 @@ import okhttp3.OkHttpClient import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.oppia.android.data.backends.api.MockStoryService import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings -import org.oppia.android.data.backends.gae.api.StoryService +import org.oppia.android.testing.network.MockStoryService import org.robolectric.annotation.LooperMode import retrofit2.Retrofit import retrofit2.converter.moshi.MoshiConverterFactory @@ -21,7 +20,7 @@ import retrofit2.mock.NetworkBehavior */ @RunWith(AndroidJUnit4::class) @LooperMode(LooperMode.Mode.PAUSED) -class MockStoryTest { +class StoryServiceTest { private lateinit var mockRetrofit: MockRetrofit private lateinit var retrofit: Retrofit diff --git a/data/src/test/java/org/oppia/android/data/backends/test/MockSubtopicTest.kt b/data/src/test/java/org/oppia/android/data/backends/gae/api/SubtopicServiceTest.kt similarity index 89% rename from data/src/test/java/org/oppia/android/data/backends/test/MockSubtopicTest.kt rename to data/src/test/java/org/oppia/android/data/backends/gae/api/SubtopicServiceTest.kt index 7cfb13a9084..162d25f71b4 100755 --- a/data/src/test/java/org/oppia/android/data/backends/test/MockSubtopicTest.kt +++ b/data/src/test/java/org/oppia/android/data/backends/gae/api/SubtopicServiceTest.kt @@ -1,4 +1,4 @@ -package org.oppia.android.data.backends.test +package org.oppia.android.data.backends.gae.api import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat @@ -6,10 +6,9 @@ import okhttp3.OkHttpClient import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.oppia.android.data.backends.api.MockSubtopicService import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings -import org.oppia.android.data.backends.gae.api.SubtopicService +import org.oppia.android.testing.network.MockSubtopicService import org.robolectric.annotation.LooperMode import retrofit2.Retrofit import retrofit2.converter.moshi.MoshiConverterFactory @@ -21,7 +20,7 @@ import retrofit2.mock.NetworkBehavior */ @RunWith(AndroidJUnit4::class) @LooperMode(LooperMode.Mode.PAUSED) -class MockSubtopicTest { +class SubtopicServiceTest { private lateinit var mockRetrofit: MockRetrofit private lateinit var retrofit: Retrofit diff --git a/data/src/test/java/org/oppia/android/data/backends/test/MockTopicTest.kt b/data/src/test/java/org/oppia/android/data/backends/gae/api/TopicServiceTest.kt similarity index 89% rename from data/src/test/java/org/oppia/android/data/backends/test/MockTopicTest.kt rename to data/src/test/java/org/oppia/android/data/backends/gae/api/TopicServiceTest.kt index 23dce9603c1..2e9678e1720 100755 --- a/data/src/test/java/org/oppia/android/data/backends/test/MockTopicTest.kt +++ b/data/src/test/java/org/oppia/android/data/backends/gae/api/TopicServiceTest.kt @@ -1,4 +1,4 @@ -package org.oppia.android.data.backends.test +package org.oppia.android.data.backends.gae.api import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat @@ -6,10 +6,9 @@ import okhttp3.OkHttpClient import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.oppia.android.data.backends.api.MockTopicService import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings -import org.oppia.android.data.backends.gae.api.TopicService +import org.oppia.android.testing.network.MockTopicService import org.robolectric.annotation.LooperMode import retrofit2.Retrofit import retrofit2.converter.moshi.MoshiConverterFactory @@ -21,7 +20,7 @@ import retrofit2.mock.NetworkBehavior */ @RunWith(AndroidJUnit4::class) @LooperMode(LooperMode.Mode.PAUSED) -class MockTopicTest { +class TopicServiceTest { private lateinit var mockRetrofit: MockRetrofit private lateinit var retrofit: Retrofit diff --git a/data/src/test/java/org/oppia/android/data/backends/ApiUtils.kt b/testing/src/main/java/org/oppia/android/testing/network/ApiUtils.kt similarity index 93% rename from data/src/test/java/org/oppia/android/data/backends/ApiUtils.kt rename to testing/src/main/java/org/oppia/android/testing/network/ApiUtils.kt index 42b85362931..a91275e77c6 100644 --- a/data/src/test/java/org/oppia/android/data/backends/ApiUtils.kt +++ b/testing/src/main/java/org/oppia/android/testing/network/ApiUtils.kt @@ -1,4 +1,4 @@ -package org.oppia.android.data.backends +package org.oppia.android.testing.network import org.json.JSONException import org.json.JSONObject diff --git a/data/src/test/java/org/oppia/android/data/backends/api/MockClassroomService.kt b/testing/src/main/java/org/oppia/android/testing/network/MockClassroomService.kt similarity index 94% rename from data/src/test/java/org/oppia/android/data/backends/api/MockClassroomService.kt rename to testing/src/main/java/org/oppia/android/testing/network/MockClassroomService.kt index c742faf4b53..c8c8debf24a 100755 --- a/data/src/test/java/org/oppia/android/data/backends/api/MockClassroomService.kt +++ b/testing/src/main/java/org/oppia/android/testing/network/MockClassroomService.kt @@ -1,8 +1,7 @@ -package org.oppia.android.data.backends.api +package org.oppia.android.testing.network import com.squareup.moshi.JsonAdapter import com.squareup.moshi.Moshi -import org.oppia.android.data.backends.ApiUtils import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings import org.oppia.android.data.backends.gae.api.ClassroomService diff --git a/data/src/test/java/org/oppia/android/data/backends/api/MockConceptCardService.kt b/testing/src/main/java/org/oppia/android/testing/network/MockConceptCardService.kt similarity index 94% rename from data/src/test/java/org/oppia/android/data/backends/api/MockConceptCardService.kt rename to testing/src/main/java/org/oppia/android/testing/network/MockConceptCardService.kt index a1ca6c8584a..1d21a5dd1f1 100644 --- a/data/src/test/java/org/oppia/android/data/backends/api/MockConceptCardService.kt +++ b/testing/src/main/java/org/oppia/android/testing/network/MockConceptCardService.kt @@ -1,8 +1,7 @@ -package org.oppia.android.data.backends.api +package org.oppia.android.testing.network import com.squareup.moshi.JsonAdapter import com.squareup.moshi.Moshi -import org.oppia.android.data.backends.ApiUtils import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings import org.oppia.android.data.backends.gae.api.ConceptCardService diff --git a/data/src/test/java/org/oppia/android/data/backends/api/MockExplorationService.kt b/testing/src/main/java/org/oppia/android/testing/network/MockExplorationService.kt similarity index 94% rename from data/src/test/java/org/oppia/android/data/backends/api/MockExplorationService.kt rename to testing/src/main/java/org/oppia/android/testing/network/MockExplorationService.kt index 10fcef0e6fe..c16c67c72fe 100755 --- a/data/src/test/java/org/oppia/android/data/backends/api/MockExplorationService.kt +++ b/testing/src/main/java/org/oppia/android/testing/network/MockExplorationService.kt @@ -1,8 +1,7 @@ -package org.oppia.android.data.backends.api +package org.oppia.android.testing.network import com.squareup.moshi.JsonAdapter import com.squareup.moshi.Moshi -import org.oppia.android.data.backends.ApiUtils import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings import org.oppia.android.data.backends.gae.api.ExplorationService diff --git a/data/src/test/java/org/oppia/android/data/backends/api/MockFeedbackReportingService.kt b/testing/src/main/java/org/oppia/android/testing/network/MockFeedbackReportingService.kt similarity index 79% rename from data/src/test/java/org/oppia/android/data/backends/api/MockFeedbackReportingService.kt rename to testing/src/main/java/org/oppia/android/testing/network/MockFeedbackReportingService.kt index 6a2887daea3..e9f7a3a722b 100644 --- a/data/src/test/java/org/oppia/android/data/backends/api/MockFeedbackReportingService.kt +++ b/testing/src/main/java/org/oppia/android/testing/network/MockFeedbackReportingService.kt @@ -1,11 +1,11 @@ -package org.oppia.android.data.backends.api +package org.oppia.android.testing.network import org.oppia.android.data.backends.gae.api.FeedbackReportingService import org.oppia.android.data.backends.gae.model.GaeFeedbackReport import retrofit2.Call import retrofit2.mock.BehaviorDelegate -/** Mock FeedbackReportingService to check that the service is properly requested. */ +/** Mock [FeedbackReportingService] to check that the service is properly requested. */ class MockFeedbackReportingService( private val delegate: BehaviorDelegate ) : FeedbackReportingService { diff --git a/data/src/test/java/org/oppia/android/data/backends/api/MockQuestionPlayerService.kt b/testing/src/main/java/org/oppia/android/testing/network/MockQuestionPlayerService.kt similarity index 94% rename from data/src/test/java/org/oppia/android/data/backends/api/MockQuestionPlayerService.kt rename to testing/src/main/java/org/oppia/android/testing/network/MockQuestionPlayerService.kt index df4a54c45aa..3c084dd37af 100644 --- a/data/src/test/java/org/oppia/android/data/backends/api/MockQuestionPlayerService.kt +++ b/testing/src/main/java/org/oppia/android/testing/network/MockQuestionPlayerService.kt @@ -1,8 +1,7 @@ -package org.oppia.android.data.backends.api +package org.oppia.android.testing.network import com.squareup.moshi.JsonAdapter import com.squareup.moshi.Moshi -import org.oppia.android.data.backends.ApiUtils import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings import org.oppia.android.data.backends.gae.api.QuestionPlayerService diff --git a/data/src/test/java/org/oppia/android/data/backends/api/MockStoryService.kt b/testing/src/main/java/org/oppia/android/testing/network/MockStoryService.kt similarity index 93% rename from data/src/test/java/org/oppia/android/data/backends/api/MockStoryService.kt rename to testing/src/main/java/org/oppia/android/testing/network/MockStoryService.kt index 6388f7e89fb..05d2dc64cd8 100644 --- a/data/src/test/java/org/oppia/android/data/backends/api/MockStoryService.kt +++ b/testing/src/main/java/org/oppia/android/testing/network/MockStoryService.kt @@ -1,8 +1,7 @@ -package org.oppia.android.data.backends.api +package org.oppia.android.testing.network import com.squareup.moshi.JsonAdapter import com.squareup.moshi.Moshi -import org.oppia.android.data.backends.ApiUtils import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings import org.oppia.android.data.backends.gae.api.StoryService diff --git a/data/src/test/java/org/oppia/android/data/backends/api/MockSubtopicService.kt b/testing/src/main/java/org/oppia/android/testing/network/MockSubtopicService.kt similarity index 94% rename from data/src/test/java/org/oppia/android/data/backends/api/MockSubtopicService.kt rename to testing/src/main/java/org/oppia/android/testing/network/MockSubtopicService.kt index f0ec38041f3..82fa407a55a 100644 --- a/data/src/test/java/org/oppia/android/data/backends/api/MockSubtopicService.kt +++ b/testing/src/main/java/org/oppia/android/testing/network/MockSubtopicService.kt @@ -1,8 +1,7 @@ -package org.oppia.android.data.backends.api +package org.oppia.android.testing.network import com.squareup.moshi.JsonAdapter import com.squareup.moshi.Moshi -import org.oppia.android.data.backends.ApiUtils import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings import org.oppia.android.data.backends.gae.api.SubtopicService diff --git a/data/src/test/java/org/oppia/android/data/backends/api/MockTopicService.kt b/testing/src/main/java/org/oppia/android/testing/network/MockTopicService.kt similarity index 93% rename from data/src/test/java/org/oppia/android/data/backends/api/MockTopicService.kt rename to testing/src/main/java/org/oppia/android/testing/network/MockTopicService.kt index 0224f8001c7..d9a76266aff 100644 --- a/data/src/test/java/org/oppia/android/data/backends/api/MockTopicService.kt +++ b/testing/src/main/java/org/oppia/android/testing/network/MockTopicService.kt @@ -1,8 +1,7 @@ -package org.oppia.android.data.backends.api +package org.oppia.android.testing.network import com.squareup.moshi.JsonAdapter import com.squareup.moshi.Moshi -import org.oppia.android.data.backends.ApiUtils import org.oppia.android.data.backends.gae.NetworkInterceptor import org.oppia.android.data.backends.gae.NetworkSettings import org.oppia.android.data.backends.gae.api.TopicService