-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into #18-cleaning-up-code
# Conflicts: # library/data/src/main/java/id/apwdevs/app/data/mediator/PopularMovieRemoteMediator.kt # library/data/src/main/java/id/apwdevs/app/data/source/local/entity/items/MovieEntity.kt
- Loading branch information
Showing
43 changed files
with
1,636 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
feature/detail/src/androidTest/java/id/apwdevs/app/detail/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
21 changes: 4 additions & 17 deletions
21
...detail/src/androidTest/java/id/apwdevs/app/detail/dispatcher/DetailScopeMockDispatcher.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,23 @@ | ||
package id.apwdevs.app.detail.dispatcher | ||
|
||
import android.content.Context | ||
import android.util.Log | ||
import id.apwdevs.app.data.utils.Config | ||
import id.apwdevs.app.detail.data.AssetData | ||
import id.apwdevs.app.libs.util.provideResponse | ||
import okhttp3.mockwebserver.Dispatcher | ||
import okhttp3.mockwebserver.MockResponse | ||
import okhttp3.mockwebserver.RecordedRequest | ||
import id.apwdevs.app.libs.util.ScopeDispatcher | ||
|
||
/** | ||
* Dispatch all the network request needed for scope DetailItemFragment | ||
* Must meet all the test case. | ||
*/ | ||
|
||
class DetailScopeMockDispatcher( | ||
private val context: Context | ||
) : Dispatcher() { | ||
context: Context | ||
) : ScopeDispatcher(context) { | ||
|
||
private val mappingRequest = mapOf( | ||
override val mappingRequest = mapOf( | ||
"/movie/791373?api_key=${Config.TOKEN}&language=en-US" to AssetData.DETAIL_MOVIE_OK, | ||
"/tv/88396?api_key=${Config.TOKEN}&language=en-US" to AssetData.DETAIL_TVSHOW_OK, | ||
"/genre/movie/list?api_key=${Config.TOKEN}&language=en-US" to AssetData.GENRE_MOVIE_OK, | ||
"/genre/tv/list?api_key=${Config.TOKEN}&language=en-US" to AssetData.GENRE_TVSHOW_OK | ||
) | ||
|
||
override fun dispatch(request: RecordedRequest): MockResponse { | ||
Log.d("MockDispatcher", "Received Request Path: ${request.path}") | ||
val req = mappingRequest[request.path] | ||
return req?.let { | ||
context.provideResponse(it, 200) | ||
} ?: context.provideResponse(AssetData.DETAIL_404, 404) | ||
} | ||
|
||
} |
141 changes: 0 additions & 141 deletions
141
feature/detail/src/androidTest/java/id/apwdevs/app/detail/ui/DetailFragmentBaseCase.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.