Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5: GAE Abstraction part 1 - Topic Page handler [Blocked: #85] #78

Merged
merged 29 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7269d15
Initial introduction of the data source module.
BenHenning Aug 27, 2019
ac16d10
Data module dependencies, retrofit and models
Aug 27, 2019
bf96010
Removed kapt from build.gradle in data
Aug 27, 2019
ef62740
Javadoc comments
Aug 27, 2019
93d703b
Introduce one possible integration with Dagger 2.
BenHenning Aug 28, 2019
3679c4c
Javadoc comments added
Aug 28, 2019
a4e0ad5
Reolved Javadoc mistakes
Aug 28, 2019
d187b56
Update build.gradle proto directive to use 'compile' instead of (#81)
Aug 28, 2019
d27d161
Merge remote-tracking branch 'upstream/introduce-data-module' into ga…
Aug 28, 2019
5d5da22
Renaming test cases
Aug 28, 2019
07b51d5
Test cases for TopicService
Aug 30, 2019
a52bb57
Made changes to OppiaGaeClient
Aug 30, 2019
1d6c39b
Made changes to OppiaGaeClient
Aug 30, 2019
b476e8e
TopicService test code using Json response
Sep 3, 2019
4aadf7a
Revert changes in codeStyles/Project.xml
Sep 3, 2019
d03a527
Revert changes in codeStyles/Project.xml
Sep 3, 2019
a380eaa
Optimise imports
Sep 3, 2019
1da9475
Check NetworkInterceptor part
Sep 3, 2019
842dc21
Fix part of #9: Introduce Retrofit classroom data handler service (#83)
veena14cs Sep 4, 2019
ffde992
Resolve typo
Sep 5, 2019
f5ae749
Merge branch 'gae-abstraction-base' of https://github.com/oppia/oppia…
Sep 5, 2019
0049548
Resolve merge conflicts with develop branch
Sep 5, 2019
cd94945
NetworkModule introduced
Sep 5, 2019
e392406
Daggerify NetworkInterceptor
Sep 5, 2019
5eccceb
Make retrofit dependency as api
Sep 5, 2019
1751f36
Javadocs and linking of oppia-web to models
Sep 5, 2019
798cf41
Changes in Javadoc, naming and test cases code
Sep 6, 2019
80249a8
Merge remote-tracking branch 'upstream/develop' into gae-abstraction-…
Sep 10, 2019
bb62037
Updated TODO comments and NetworkInterceptorTest
Sep 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Updated TODO comments and NetworkInterceptorTest
  • Loading branch information
Rajat Talesra committed Sep 10, 2019
commit bb62037b2bd75a18891e84ec20ac8ce4fe7643ee
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ dependencies {
kaptAndroidTest(
'com.google.dagger:dagger-compiler:2.24'
)
//TODO (#59): Remove this once Bazel is introduced
// TODO (#59): Remove this once Bazel is introduced
api project(':data')
rt4914 marked this conversation as resolved.
Show resolved Hide resolved
implementation project(":model")
implementation project(":domain")
Expand Down
4 changes: 2 additions & 2 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ dependencies {
'org.mockito:mockito-core:2.19.0',
'org.robolectric:robolectric:4.3',
)
//TODO (#59): Remove this once Bazel is introduced
//TODO (#97): Isolate retrofit-mock dependency from production
// TODO (#59): Remove this once Bazel is introduced
// TODO (#97): Isolate retrofit-mock dependency from production
api(
'com.squareup.retrofit2:converter-moshi:2.5.0',
'com.squareup.retrofit2:retrofit:2.5.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,23 @@ import org.oppia.util.threading.BackgroundDispatcher
import org.oppia.util.threading.BlockingDispatcher
import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory
import javax.inject.Inject
import javax.inject.Qualifier
import javax.inject.Singleton

/** Tests for [NetworkInterceptor] */
@RunWith(AndroidJUnit4::class)
class NetworkInterceptorTest {

@Inject lateinit var networkInterceptor: NetworkInterceptor

@Before
fun setUp() {
setUpTestApplicationComponent()
}

@Test
fun testNetworkInterceptor_withXssiPrefix_removesXssiPrefix() {
val networkInterceptor = NetworkInterceptor()
val rawJson: String =
networkInterceptor.removeXSSIPrefix(FakeJsonResponse.DUMMY_RESPONSE_WITH_XSSI_PREFIX)

Expand All @@ -50,7 +52,6 @@ class NetworkInterceptorTest {

@Test
fun testNetworkInterceptor_withoutXssiPrefix_removesXssiPrefix() {
val networkInterceptor = NetworkInterceptor()
val rawJson: String =
networkInterceptor.removeXSSIPrefix(FakeJsonResponse.DUMMY_RESPONSE_WITHOUT_XSSI_PREFIX)

Expand All @@ -70,19 +71,6 @@ class NetworkInterceptorTest {
// TODO(#89): Move this to a common test application component.
@Module
class TestNetworkModule {
@OppiaRetrofit
@Provides
@Singleton
fun provideRetrofitInstance(): Retrofit {
val client = OkHttpClient.Builder()
client.addInterceptor(NetworkInterceptor())

return retrofit2.Retrofit.Builder()
.baseUrl(NetworkSettings.getBaseUrl())
.addConverterFactory(MoshiConverterFactory.create())
.client(client.build())
.build()
}

@Provides
@Singleton
Expand All @@ -104,5 +92,6 @@ class NetworkInterceptorTest {
}

fun inject(networkInterceptorTest: NetworkInterceptorTest)
fun inject(networkInterceptor: NetworkInterceptor)
}
rt4914 marked this conversation as resolved.
Show resolved Hide resolved
}