question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Non final `Stopwatch`

See original GitHub issue

Currently 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:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
lowassercommented, Jan 30, 2017

Can you discuss why you wouldn’t just use a Stopwatch created with a mocked or faked Ticker?

1reaction
Stephan202commented, Jan 30, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found