Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
@MockOnly
rule was introduced by #517 and then removed when migrating to Junit 5 in #768 because it was not used. Now I would need it again for #788, so this PR reintroduces it as a Junit 5 extension.In #517 the rule also had a
reason()
, to make sure devs give a reason for making a test mock only, but I don't seem to be able to have Android Studio / Gradle print out ignore reasons for me, so I skipped adding that.This PR also makes
DownloaderFactory
's methods static, so that there is no need to create a new instance each time and also because I needed to extractgetDownloaderType
from theDownloaderFactory.getDownloader
method.@XiangRongLin