crowdin / crowdin-api-client-java

Java client library for Crowdin API
https://jitpack.io/#crowdin/crowdin-api-client-java
MIT License
64 stars 40 forks source link

test: Add more Unit tests for the notifications package #202

Closed PickBas closed 9 months ago

PickBas commented 9 months ago

Closes #196.

@andrii-bodnar I've added a couple of tests, but I've encountered an issue.

The tests could not be initialized due to the fact that

  1. sendNotificationToOrganizationMembersByRoleTest()
  2. sendNotificationToOrganizationMembersByUserIdsTest()
  3. sendNotificationToAuthenticatedUserTest()

Hit the same URL, so they cannot be collected to a HashMap.

I've introduced a workaround: moved from Map<String, RequestMock> to Map<String, List<RequestMock>> inside TestHttpClient. If you have any suggestions on how to make it better, I will make the improvements

codecov-commenter commented 9 months ago

Codecov Report

Merging #202 (2341ec3) into master (c70f8e2) will increase coverage by 0.10%. Report is 1 commits behind head on master. The diff coverage is n/a.

@@             Coverage Diff              @@
##             master     #202      +/-   ##
============================================
+ Coverage     50.74%   50.84%   +0.10%     
- Complexity      951      953       +2     
============================================
  Files           437      437              
  Lines          4060     4060              
  Branches        110      110              
============================================
+ Hits           2060     2064       +4     
+ Misses         1972     1968       -4     
  Partials         28       28              
Files Coverage Δ
...crowdin/client/notifications/NotificationsApi.java 84.62% <ø> (+23.08%) :arrow_up:

... and 1 file with indirect coverage changes