-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Inject a clock instead of mocking currentTimeMS #2996
Comments
would indeed be better for unit testing, any idea of the impact of this change? |
will probably be a big diff but it does not really change any logic, so it should be safe. |
While it's nice to clean up the code I wonder if it's really worthwhile right now. I see issues with current trade protocol and performance issues as more urgent. People are having problem at startup with the app not starting or being very slow and there are a few bugs out there causing people to lose money trying to initiate trades or transactions failing for unclear reasons. This kind of refactor is probably a lot easier to understand though, and perhaps a good start rather than diving straight into the most sensitive parts of the code. All depends on how much work and the risk to stability. |
I'm just writing issues as I notice problems, so others can chime in with their opinion. |
Yes, that's how I understood it. I'm adding my opinion on where effort is probably best spent at this point. I think it's good that you open these issues and I don't disagree with the issue itself. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. Feel free to reopen it if you think it is still relevant. |
time is a dependency like any other and it needs to be injected where needed.
see https://docs.oracle.com/javase/8/docs/api/java/time/Clock.html
https://github.com/robfletcher/test-clock
The text was updated successfully, but these errors were encountered: