Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add @MockOnly Junit 5 extension #816

Merged
merged 3 commits into from
Mar 19, 2022
Merged

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Mar 16, 2022

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 extract getDownloaderType from the DownloaderFactory.getDownloader method.

@XiangRongLin

Copy link
Collaborator

@XiangRongLin XiangRongLin left a comment

Choose a reason for hiding this comment

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

I haven't tested it, but looks good.

@Stypox Stypox merged commit d8f2031 into TeamNewPipe:dev Mar 19, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants