#1988: improvment of url updater tests#2012
Conversation
- Extended AbstractUrlUpdater with new private final field and added constructor - Extended JsonUrlUpdater and JavaUrlUpdater with additional constructors - Updated JavaUrlUpdaterTest to use JavaUrlUpdater without the mock and deleted JavaUrlUpdaterMock.java
- Refactored DOWNLOAD_BASE_URL and VERSION_BASE_URL according to ticket description in files where changes there necessary.
…y use mock URLs instead of production ones. Also added comments to constructors.
Coverage Report for CI Build 27545523906Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage decreased (-0.009%) to 71.043%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions371 previously-covered lines in 53 files lost coverage.
Coverage Stats💛 - Coveralls |
tineff96
left a comment
There was a problem hiding this comment.
Very nice refactoring overall! Moving the download/version base URLs into constructor parameters makes the updater classes much easier to test with the real production implementations and removes a lot of dedicated mock subclasses. This clearly took quite some dedication.
One small robustness question: would AbstractUrlUpdater be the right place to validate the new base URL constructor arguments? I mainly see this as a possible issue for future tests or subclasses passing custom WireMock URLs. If invalid values such as null or blank strings are not guarded elsewhere, failing fast in the constructor could make misconfigurations easier to diagnose.
…lUpdater for null and empty values.
|
I see your point. I added validation of the arguments passed to the constructor of |
This PR fixes #1988: Refactored UrlUpdaterTests to not use mock classes
Implemented changes:
DOWNLOAD_BASE_URLandVERSION_BASE_URLand and pass them up the constructorsgetDownloadBaseUrl()andgetVersionBaseUrl()and make use of new constructor to pass mock urlsTesting instructions
Please add conscise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:
mainBranch and runmvn -pl url-updater -am clean testmvn -pl url-updater -am clean test(Time of writing: all 70 tests should run successfully)Checklist for this PR
Make sure everything is checked before merging this PR. For further info please also see
our DoD.
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.bat). If no issue ID exists, title only.In Progressand assigned to you or there is no issue (might happen for very small PRs)with
internal