Skip to content

getSubCategoryList and getParentCategoryList migrated to retrofit #3055

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

Conversation

ilgazer
Copy link
Contributor

@ilgazer ilgazer commented Jul 6, 2019

As a part of #3026 , this PR migrates ApacheHttpClientMediaWikiApi#getSubCategoryList to CategoryClient#getSubCategoryList and ApacheHttpClientMediaWikiApi#getParentCategoryList to CategoryClient#getParentCategoryList.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

✅ A review job has been created and sent to the PullRequest network.


@ilgazer you can click here to see the review status or cancel the code review job.

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?

@codecov-io
Copy link

Codecov Report

Merging #3055 into backend-overhaul will increase coverage by 0.02%.
The diff coverage is 38.46%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           backend-overhaul   #3055      +/-   ##
===================================================
+ Coverage              4.71%   4.74%   +0.02%     
===================================================
  Files                   261     261              
  Lines                 12195   12149      -46     
  Branches               1043    1033      -10     
===================================================
+ Hits                    575     576       +1     
+ Misses                11581   11533      -48     
- Partials                 39      40       +1
Impacted Files Coverage Δ
.../nrw/commons/category/SubCategoryListFragment.java 0% <0%> (ø) ⬆️
.../java/fr/free/nrw/commons/di/NetworkingModule.java 0% <0%> (ø) ⬆️
...rw/commons/mwapi/ApacheHttpClientMediaWikiApi.java 0% <0%> (ø) ⬆️
...a/fr/free/nrw/commons/category/CategoryClient.java 94.73% <83.33%> (-5.27%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52284b8...e3039eb. Read the comment docs.

@maskaravivek
Copy link
Member

Thanks, @ilgazer. You are very quick with your PRs and the changes look good. :)

@maskaravivek maskaravivek merged commit 807ce04 into commons-app:backend-overhaul Jul 6, 2019
@ilgazer
Copy link
Contributor Author

ilgazer commented Jul 6, 2019

You're welcome :) When you have spare time, can you give me some feedback on my tests? The ones I write seem somewhat useless to me :|

@maskaravivek
Copy link
Member

You're welcome :) When you have spare time, can you give me some feedback on my tests? The ones I write seem somewhat useless to me :|

Yes, IMO for network layer we should use MockWebServer to write tests. Those tests can actually simulate different responses received from the server.

For ref: https://android.jlelse.eu/unit-test-api-calls-with-mockwebserver-d4fab11de847

maskaravivek pushed a commit to maskaravivek/apps-android-commons that referenced this pull request Jul 6, 2019
…mmons-app#3055)

* Migrated getSubCategoryList to retrofit

* Migrated getParentCategoryList to retrofit

* Removed obsolete functions

* Added tests

* Fixed small bugs
@ilgazer ilgazer deleted the backend-overhaul-retrofit-categories branch July 6, 2019 15:05
maskaravivek pushed a commit to maskaravivek/apps-android-commons that referenced this pull request Jul 7, 2019
…mmons-app#3055)

* Migrated getSubCategoryList to retrofit

* Migrated getParentCategoryList to retrofit

* Removed obsolete functions

* Added tests

* Fixed small bugs
maskaravivek pushed a commit to maskaravivek/apps-android-commons that referenced this pull request Jul 7, 2019
…mmons-app#3055)

* Migrated getSubCategoryList to retrofit

* Migrated getParentCategoryList to retrofit

* Removed obsolete functions

* Added tests

* Fixed small bugs
maskaravivek pushed a commit to maskaravivek/apps-android-commons that referenced this pull request Jul 10, 2019
…mmons-app#3055)

* Migrated getSubCategoryList to retrofit

* Migrated getParentCategoryList to retrofit

* Removed obsolete functions

* Added tests

* Fixed small bugs
maskaravivek pushed a commit that referenced this pull request Jul 15, 2019
…Client (#3056)

* With media client APIs migrated to retrofit (#2998)

* With media client APIs migrated to retrofit

* Add test cases and java docs

* Fix test

* Fix build

* Fix build and other minor issues

* Fix tests

* Categories related client API's migrated to retrofit (#3053)

* Commit 1

* searchCategories migrated to retrofit

* SearchCategoriesFragment migrated to new API

* Removed unused code

* Created tests

* implemented searching by prefix
fixed SearchCategoryFragment behaviour where the same categories would be added to the list instead of new ones.

* added tests

* Migrated searchTitles to searchCategories, function behaviour seems identical

* With media client APIs migrated to retrofit (#2998)

* With media client APIs migrated to retrofit

* Add test cases and java docs

* Fix test

* Fix build

* Fix build and other minor issues

* Fix tests

* Categories related client API's migrated to retrofit (#3053)

* Commit 1

* searchCategories migrated to retrofit

* SearchCategoriesFragment migrated to new API

* Removed unused code

* Created tests

* implemented searching by prefix
fixed SearchCategoryFragment behaviour where the same categories would be added to the list instead of new ones.

* added tests

* Migrated searchTitles to searchCategories, function behaviour seems identical

* OkHttpJsonApi#getMediaList migrated to retrofit (#3054)

* Migrated OkHttpJsonApi#getMediaList partially to MediaClient#getCategoryImages

* Migrated rest of OkHttpJsonApi#getMediaList functionality to MediaClient#getCategoryImages

* Removed unused code and tests

* Fixed small bug

* Added tests

* Removed unused CategoryImageController

* getSubCategoryList and getParentCategoryList migrated to retrofit (#3055)

* Migrated getSubCategoryList to retrofit

* Migrated getParentCategoryList to retrofit

* Removed obsolete functions

* Added tests

* Fixed small bugs

* Migrated OkHttpJsonApiClient#getMedia and getPictureOfTheDay to MediaClient

* Removed obsolete functions and added tests

* Fixed merge errors

* With media client APIs migrated to retrofit (#2998)

* With media client APIs migrated to retrofit

* Add test cases and java docs

* Fix test

* Fix build

* Fix build and other minor issues

* Fix tests

* Categories related client API's migrated to retrofit (#3053)

* Commit 1

* searchCategories migrated to retrofit

* SearchCategoriesFragment migrated to new API

* Removed unused code

* Created tests

* implemented searching by prefix
fixed SearchCategoryFragment behaviour where the same categories would be added to the list instead of new ones.

* added tests

* Migrated searchTitles to searchCategories, function behaviour seems identical

* OkHttpJsonApi#getMediaList migrated to retrofit (#3054)

* Migrated OkHttpJsonApi#getMediaList partially to MediaClient#getCategoryImages

* Migrated rest of OkHttpJsonApi#getMediaList functionality to MediaClient#getCategoryImages

* Removed unused code and tests

* Fixed small bug

* Added tests

* Removed unused CategoryImageController

* getSubCategoryList and getParentCategoryList migrated to retrofit (#3055)

* Migrated getSubCategoryList to retrofit

* Migrated getParentCategoryList to retrofit

* Removed obsolete functions

* Added tests

* Fixed small bugs

* Consume login client from data client library (#2894)

Fix actions for review client

Use data client library for notifications

With delete helper migrated to data client

With wikidata edits

With notifications and modifications migrated to data client

With upload migrated to retrofit

Delete unused code

Reuse thank interface from the library
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.

3 participants