Skip to content

#3841 Unit Test DepictsClient #3842

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

Merged
merged 42 commits into from
Jun 26, 2020
Merged

Conversation

macgills
Copy link
Contributor

@macgills macgills commented Jun 24, 2020

Description (required)

Fixes #3841

What changes did you make and why?

  • add tests

Tests performed (required)

Tested ProdDebug on Nexus5x with API level 27

macgills added 30 commits May 12, 2020 12:51
…tions-pagination

# Conflicts:
#	app/src/main/java/fr/free/nrw/commons/category/CategoryClient.java
#	app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java
#	app/src/main/java/fr/free/nrw/commons/upload/categories/UploadCategoriesFragment.java
#	app/src/main/res/values/strings.xml
#	gradle.properties
…ter unit tests now that view is not nullable - fix Category prefix imports
…nctionality of pagination to base classes - add category pagination
…ImagesFragment - tidy up showing the empty view - make search fragments show snackbar with appropriate text
…ories-pagination

# Conflicts:
#	app/src/main/java/fr/free/nrw/commons/explore/SearchActivity.java
#	app/src/main/java/fr/free/nrw/commons/explore/SearchModule.java
#	app/src/main/java/fr/free/nrw/commons/explore/categories/SearchCategoryFragment.java
#	app/src/main/java/fr/free/nrw/commons/explore/depictions/DepictionAdapter.kt
#	app/src/main/java/fr/free/nrw/commons/explore/depictions/SearchDepictionsFragment.kt
#	app/src/main/java/fr/free/nrw/commons/explore/depictions/SearchDepictionsFragmentContract.kt
#	app/src/main/java/fr/free/nrw/commons/explore/depictions/SearchDepictionsFragmentPresenter.kt
#	app/src/main/java/fr/free/nrw/commons/nearby/PlaceAdapterDelegate.kt
#	app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java
…-images-pagination

# Conflicts:
#	app/src/main/java/fr/free/nrw/commons/Media.java
#	app/src/main/java/fr/free/nrw/commons/media/MediaClient.java
#	app/src/main/java/fr/free/nrw/commons/media/MediaDetailInterface.java
#	app/src/main/java/fr/free/nrw/commons/media/MediaInterface.java
…construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version
…generator to construct media for DepictedImages
…on media paging methods - convert to DepictedImages to use pagination
…-construction

# Conflicts:
#	app/src/main/java/fr/free/nrw/commons/Media.java
#	app/src/main/java/fr/free/nrw/commons/MediaDataExtractor.kt
#	app/src/main/java/fr/free/nrw/commons/contributions/Contribution.java
#	app/src/main/java/fr/free/nrw/commons/contributions/ContributionViewHolder.java
#	app/src/main/java/fr/free/nrw/commons/explore/BaseSearchFragment.kt
#	app/src/main/java/fr/free/nrw/commons/explore/depictions/SearchDepictionsFragment.kt
#	app/src/main/java/fr/free/nrw/commons/explore/media/MediaConverter.kt
#	app/src/main/java/fr/free/nrw/commons/explore/media/PageableMediaDataSource.kt
#	app/src/main/java/fr/free/nrw/commons/explore/media/SearchMediaAdapter.kt
#	app/src/main/java/fr/free/nrw/commons/media/MediaClient.kt
#	app/src/main/java/fr/free/nrw/commons/media/MediaInterface.java
#	app/src/main/java/fr/free/nrw/commons/upload/WikidataPlace.kt
#	app/src/test/kotlin/fr/free/nrw/commons/explore/BaseSearchPresenterTest.kt
#	app/src/test/kotlin/fr/free/nrw/commons/explore/media/PageableMediaDataSourceTest.kt
#	app/src/test/kotlin/fr/free/nrw/commons/media/MediaClientTest.kt
macgills added 10 commits June 18, 2020 09:02
…update wikicode to align with expected behaviour
…replace old site of thumbnail title with most relevant caption
…picted-images-pagination

# Conflicts:
#	app/src/main/java/fr/free/nrw/commons/explore/BasePagingFragment.kt
#	app/src/main/java/fr/free/nrw/commons/media/MediaClient.kt
…bDepictionList with Child and Parent Fragments - replace contracts with simple presenter declarations - move classes to appropriate packages - delete unused network models - delete duplicated paging classes
…CategoryImagesListFragment with CategoriesMediaFragment - disallow the construction of media objects without imageinfo
…rt subcategories - add continuation support in category client - rely on interfaces for callbacks of PageableMediaFragments
…rt parent categories - delete list fragment - creat base class to support continuation requests in clients
Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add tests to make sure this change works as expected?

@macgills macgills marked this pull request as draft June 24, 2020 10:52
Base automatically changed from macgills/3822-sub-category-list-pagination to master June 25, 2020 12:44
…ts-client-tests

# Conflicts:
#	app/src/main/java/fr/free/nrw/commons/explore/SearchActivity.java
#	app/src/main/java/fr/free/nrw/commons/explore/depictions/DepictsClient.kt
#	app/src/main/java/fr/free/nrw/commons/explore/depictions/child/PageableChildDepictionsDataSource.kt
#	app/src/main/java/fr/free/nrw/commons/explore/depictions/media/DepictedImagesFragment.kt
#	app/src/main/java/fr/free/nrw/commons/explore/depictions/parent/PageableParentDepictionsDataSource.kt
#	app/src/main/java/fr/free/nrw/commons/mwapi/OkHttpJsonApiClient.java
#	app/src/test/kotlin/ModelFunctions.kt
#	app/src/test/kotlin/fr/free/nrw/commons/explore/categroies/PageableSearchCategoriesDataSourceTest.kt
#	app/src/test/kotlin/fr/free/nrw/commons/explore/depictions/child/PageableChildDepictionsDataSourceTest.kt
#	app/src/test/kotlin/fr/free/nrw/commons/explore/depictions/parent/PageableParentDepictionsDataSourceTest.kt
@macgills macgills marked this pull request as ready for review June 25, 2020 13:33
@misaochan misaochan merged commit 542d321 into master Jun 26, 2020
@macgills macgills deleted the macgills/3841-depicts-client-tests branch June 26, 2020 08:29
ashishkumar468 pushed a commit to ashishkumar468/apps-android-commons that referenced this pull request Oct 10, 2020
* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace SearchDepictionsRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace UploadCategoryDepictionsRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - update BaseAdapter to be easier to use

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace SearchImagesRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace SearchCategoriesRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace NotificationRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace UploadDepictsRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace PlaceRenderer

* commons-app#3756 Convert SearchDepictionsFragment to use Pagination - convert SearchDepictionsFragment

* commons-app#3756 Convert SearchDepictionsFragment to use Pagination - fix presenter unit tests now that view is not nullable - fix Category prefix imports

* commons-app#3756 Convert SearchDepictionsFragment to use Pagination - test DataSource related classes

* commons-app#3756 Convert SearchDepictionsFragment to use Pagination - reset rx scheduler - ignore failing test

* commons-app#3760 Convert SearchCategoriesFragment to use Pagination - extract functionality of pagination to base classes - add category pagination

* commons-app#3772 Convert SearchImagesFragment to use Pagination  - convert SearchImagesFragment - tidy up showing the empty view - make search fragments show snackbar with appropriate text

* commons-app#3772 Convert SearchImagesFragment to use Pagination  - allow viewpager to load more data

* commons-app#3760 remove test that got re-added by merge

* commons-app#3760 remove duplicate dependency

* commons-app#3772 fix compilation

* commons-app#3780 Create media using a combination of Entities & MwQueryResult - construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version

* commons-app#3808 Construct media objects that depict an item id correctly - use generator to construct media for DepictedImages

* commons-app#3810 Convert DepictedImagesFragment to use Pagination - extract common media paging methods - convert to DepictedImages to use pagination

* commons-app#3810 Convert DepictedImagesFragment to use Pagination - rename base classes to better reflect usage

* commons-app#3810 Convert DepictedImagesFragment to use Pagination - map to empty result with no pages

* commons-app#3810 Convert DepictedImagesFragment to use Pagination - align test with returned values

* commons-app#3780 Create media using a combination of Entities & MwQueryResult - update wikicode to align with expected behaviour

* commons-app#3780 Create media using a combination of Entities & MwQueryResult - replace old site of thumbnail title with most relevant caption

* commons-app#3818 Convert SubDepictionListFragment to use Pagination - replace SubDepictionList with Child and Parent Fragments - replace contracts with simple presenter declarations - move classes to appropriate packages - delete unused network models - delete duplicated paging classes

* commons-app#3820 Convert CategoryImagesListFragment to use Pagination - replace CategoryImagesListFragment with CategoriesMediaFragment - disallow the construction of media objects without imageinfo

* commons-app#3822 Convert SubCategoryImagesListFragment to use Pagination - convert subcategories - add continuation support in category client - rely on interfaces for callbacks of PageableMediaFragments

* commons-app#3822 Convert SubCategoryImagesListFragment to use Pagination - convert parent categories - delete list fragment - creat base class to support continuation requests in clients

* commons-app#3822 Convert SubCategoryImagesListFragment to use Pagination - add tests for ParentCategoriesDataSource

* commons-app#3822 Convert SubCategoryImagesListFragment to use Pagination - remove no longer applicable test

* commons-app#3841 Unit Test DepictsClient - add tests

* commons-app#3841 Unit Test DepictsClient - fix return types
ashishkumar468 pushed a commit to ashishkumar468/apps-android-commons that referenced this pull request Oct 10, 2020
* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace SearchDepictionsRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace UploadCategoryDepictionsRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - update BaseAdapter to be easier to use

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace SearchImagesRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace SearchCategoriesRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace NotificationRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace UploadDepictsRenderer

* commons-app#3468 Switch from RvRenderer to AdapterDelegates - replace PlaceRenderer

* commons-app#3756 Convert SearchDepictionsFragment to use Pagination - convert SearchDepictionsFragment

* commons-app#3756 Convert SearchDepictionsFragment to use Pagination - fix presenter unit tests now that view is not nullable - fix Category prefix imports

* commons-app#3756 Convert SearchDepictionsFragment to use Pagination - test DataSource related classes

* commons-app#3756 Convert SearchDepictionsFragment to use Pagination - reset rx scheduler - ignore failing test

* commons-app#3760 Convert SearchCategoriesFragment to use Pagination - extract functionality of pagination to base classes - add category pagination

* commons-app#3772 Convert SearchImagesFragment to use Pagination  - convert SearchImagesFragment - tidy up showing the empty view - make search fragments show snackbar with appropriate text

* commons-app#3772 Convert SearchImagesFragment to use Pagination  - allow viewpager to load more data

* commons-app#3760 remove test that got re-added by merge

* commons-app#3760 remove duplicate dependency

* commons-app#3772 fix compilation

* commons-app#3780 Create media using a combination of Entities & MwQueryResult - construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version

* commons-app#3808 Construct media objects that depict an item id correctly - use generator to construct media for DepictedImages

* commons-app#3810 Convert DepictedImagesFragment to use Pagination - extract common media paging methods - convert to DepictedImages to use pagination

* commons-app#3810 Convert DepictedImagesFragment to use Pagination - rename base classes to better reflect usage

* commons-app#3810 Convert DepictedImagesFragment to use Pagination - map to empty result with no pages

* commons-app#3810 Convert DepictedImagesFragment to use Pagination - align test with returned values

* commons-app#3780 Create media using a combination of Entities & MwQueryResult - update wikicode to align with expected behaviour

* commons-app#3780 Create media using a combination of Entities & MwQueryResult - replace old site of thumbnail title with most relevant caption

* commons-app#3818 Convert SubDepictionListFragment to use Pagination - replace SubDepictionList with Child and Parent Fragments - replace contracts with simple presenter declarations - move classes to appropriate packages - delete unused network models - delete duplicated paging classes

* commons-app#3820 Convert CategoryImagesListFragment to use Pagination - replace CategoryImagesListFragment with CategoriesMediaFragment - disallow the construction of media objects without imageinfo

* commons-app#3822 Convert SubCategoryImagesListFragment to use Pagination - convert subcategories - add continuation support in category client - rely on interfaces for callbacks of PageableMediaFragments

* commons-app#3822 Convert SubCategoryImagesListFragment to use Pagination - convert parent categories - delete list fragment - creat base class to support continuation requests in clients

* commons-app#3822 Convert SubCategoryImagesListFragment to use Pagination - add tests for ParentCategoriesDataSource

* commons-app#3822 Convert SubCategoryImagesListFragment to use Pagination - remove no longer applicable test

* commons-app#3841 Unit Test DepictsClient - add tests

* commons-app#3841 Unit Test DepictsClient - fix return types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit Test DepictsClient
2 participants