Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ivan_gammel
on Dec 20, 2023
|
parent
|
context
|
favorite
| on:
How to unit test code that depends on time
In modern Java it’s pretty common to inject an application-level clock object in all components depending on time. Writing an unit test becomes easy, because you have full control over what time is returned on each call.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: