feat(data): Implement movie search data layer with Retrofit
What does this MR do?
This MR builds the complete networking and repository layer required to search for movies using the TMDB API. It provides a clean, testable, and robust data source for the upcoming search feature.
Key Components Implemented:
-
Retrofit: Sets up
RetrofitClient,TmdbApiServiceinterface, andGsonConverterFactory. -
DTOs: Defines
MovieDtoandMovieSearchResponseto accurately parse the JSON from the TMDB/search/movieendpoint. -
Repository: Implements the
MovieRepositoryinterface withMovieRepositoryImpl, which handles API calls, error catching, and mapping from network DTOs to the app'sMoviedomain model. -
Build Config: Includes a robust fix to correctly and reliably load the
TMDB_API_KEYfromlocal.propertiesinto theBuildConfig.
How has this been tested?
This data layer is verified by two types of tests:
-
Unit Test (
MovieRepositoryImplTest): UsesMockWebServerto test the repository's logic (JSON parsing, mapping, and error handling) in a fast, offline environment. -
Instrumented Test (
LiveMovieApiTest): Performs a live API call on a device/emulator to validate the entire chain, from the API key to the final data model, against the real TMDB server.
Why was this change needed?
This is a foundational piece of the application's core functionality. With this data layer in place, we can now proceed with building the SearchViewModel and connecting it to the UI.