Non final `Stopwatch`
See original GitHub issueCurrently Stopwatch
is final which makes it impossible to mock it with mockito to unit test classes using it.
It would be great to make Stopwatch
non final to avoid this problem.
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Online Stopwatch
A Simple, Fast Online Stopwatch and Online Countdown timer always available when you need it. 50% loaded.
Read more >Stopwatch (Guava: Google Core Libraries for Java 19.0 API)
An object that measures elapsed time in nanoseconds. It is useful to measure elapsed time using this class instead of direct calls to...
Read more >Online Stopwatch - easy to use - Time and Date
Create a Countdown Timer that counts down in seconds, minutes, hours and days to any date, with time zone support. It also counts...
Read more >Digital Stopwatch - No Bells, No Whistles, Simple Basic ...
Buy Digital Stopwatch - No Bells, No Whistles, Simple Basic Operation, Silent, Clear Display, ON/Off, Child Friendly, AAA Batteries (Included), ...
Read more >c# - Should I Stop Stopwatch at the end of the method?
No, you don't need to stop it. Stop() just stops tracking elapsed time. It does not free up any resources.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you discuss why you wouldn’t just use a Stopwatch created with a mocked or faked Ticker?
The excellent question of @lowasser aside, as of version 2.1.0, Mockito has incubating support for mocking final types, enums and final methods. We’re successfully using this in our project.