close
Skip to content

Unit tests for CrowdinProjectCacheProvider.getInstance()#107

Merged
andrii-bodnar merged 3 commits intocrowdin:masterfrom
picimako:cache-provider-test
May 16, 2023
Merged

Unit tests for CrowdinProjectCacheProvider.getInstance()#107
andrii-bodnar merged 3 commits intocrowdin:masterfrom
picimako:cache-provider-test

Conversation

@picimako
Copy link
Copy Markdown
Contributor

Changes

  • Introduced the CrowdinClient type along with its MockCrowdin implementation for tests, so that unit tests don't have to send real HTTP requests to Crowdin.
  • Removed the unused Project constructor argument and field of Crowdin.
    • This was supposed to simplify unit testing for getInstance() before MockCrowdin were introduced, but kept the changes because it was unused anyway.
  • Added unit tests for CrowdinProjectCacheProvider.getInstance().

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2023

Codecov Report

Merging #107 (c5dba13) into master (a5cc371) will increase coverage by 2.37%.
The diff coverage is 30.44%.

@@             Coverage Diff              @@
##             master     #107      +/-   ##
============================================
+ Coverage     17.46%   19.83%   +2.37%     
- Complexity      121      143      +22     
============================================
  Files            42       42              
  Lines          1936     1942       +6     
  Branches        232      232              
============================================
+ Hits            338      385      +47     
+ Misses         1548     1505      -43     
- Partials         50       52       +2     
Impacted Files Coverage Δ
...c/main/java/com/crowdin/action/DownloadAction.java 0.00% <0.00%> (ø)
...rowdin/action/DownloadSourceFromContextAction.java 0.00% <0.00%> (ø)
...java/com/crowdin/action/DownloadSourcesAction.java 0.00% <0.00%> (ø)
...n/action/DownloadTranslationFromContextAction.java 0.00% <0.00%> (ø)
src/main/java/com/crowdin/action/UploadAction.java 0.00% <0.00%> (ø)
...va/com/crowdin/action/UploadFromContextAction.java 0.00% <0.00%> (ø)
...a/com/crowdin/action/UploadTranslationsAction.java 0.00% <0.00%> (ø)
...in/action/UploadTranslationsFromContextAction.java 0.00% <0.00%> (ø)
...a/com/crowdin/activity/CrowdinStartupActivity.java 16.67% <0.00%> (ø)
src/main/java/com/crowdin/client/Crowdin.java 0.00% <0.00%> (ø)
... and 4 more

Copy link
Copy Markdown
Member

@andrii-bodnar andrii-bodnar left a comment

Choose a reason for hiding this comment

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

@picimako awesome, thanks a lot for your contribution! 🚀

@andrii-bodnar andrii-bodnar merged commit 9b2b822 into crowdin:master May 16, 2023
@picimako picimako deleted the cache-provider-test branch May 16, 2023 08:04
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.

Write Unit test for the CrowdinProjectCacheProvider::getInstance method

2 participants