Skip to content

Do not allow the updater to be passed in configuration #22

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2021

Conversation

phenaproxima
Copy link
Collaborator

@phenaproxima phenaproxima commented Apr 21, 2021

Over in #18, @tedbow pointed out that it seems potentially dangerous, in some situations, to allow TufValidatedComposerRepository to accept its dependencies in configuration. For unit testing, though, it's necessary to be able to mock things like the updater. Since everything happens in the repository constructor, it makes sense to just use reflection in our tests to set the private property value.

@phenaproxima phenaproxima changed the title Allow unit tests to mock the updater without passing it in configuration Mock the updater in tests without passing it in configuration Apr 21, 2021
@phenaproxima phenaproxima changed the title Mock the updater in tests without passing it in configuration Do not allow the updater to be passed in configuration Apr 21, 2021
@phenaproxima phenaproxima merged commit acded0b into main Apr 21, 2021
@phenaproxima phenaproxima deleted the inject-deps branch April 21, 2021 16:49
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.

1 participant