Skip to content
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

Fixes #197 : Blocks ability to use negative value for timeout() and after() method. #207

Merged
merged 3 commits into from May 13, 2015

Conversation

lukasz-szewc
Copy link
Contributor

It should fix issue #197.

If user uses Mockito.after() or Mockito.timeout() with negative values, then friendly reminder exception with details will be thrown.

- Removed unused field from VerificationOverTimeImpl and also from constructor's signature.
- improved encapsulation by removing 3 getters from VerificationOverTimeImpl.
- reduced visibility of few constructors in 'Timeout' and 'After' classes
@lukasz-szewc
Copy link
Contributor Author

First commit fixes the issue, second one is a little bit of refactoring: (mostly reducing visibility and increasing encapsulation).

Fixes #197 : Refactoring:

  • Removed unused field from VerificationOverTimeImpl and also from constructor's signature.
  • improved encapsulation by removing 3 getters from VerificationOverTimeImpl.
  • reduced visibility of few constructors in 'Timeout' and 'After' classes

@bric3
Copy link
Contributor

bric3 commented May 13, 2015

Nice pull request, thank you !
If comments are addressed I'll merge right away !

@lukasz-szewc
Copy link
Contributor Author

About TimeoutTest... Please look at it. The whole point of this test is to pass timer object and do mocking/verifications on it. If I use public constructor for this test I will not to able to pass timer object.
This is why constructor with this signature Timeout(long pollingPeriodMillis, VerificationMode delegate, Timer timer) was introduced by author in first place...
Should I really touch it?

BTW. There in so such thing like AfterTest

@bric3
Copy link
Contributor

bric3 commented May 13, 2015

Oh yeah I see, fair point. Just ignore what I said on that.
Ignore the AfterTest too I was a bit off this morning. Thanks for the feedback :)

bric3 added a commit that referenced this pull request May 13, 2015
Fixes #197 : Blocks ability to use negative value for timeout() and after() method.
@bric3 bric3 merged commit ce3d2fb into mockito:master May 13, 2015
@lukasz-szewc lukasz-szewc deleted the issue197 branch May 13, 2015 16:55
@bric3 bric3 added this to the 2.1 milestone Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants