Skip to content

Add Duration overloads. Fixes #1815#1818

Merged
TimvdLippe merged 2 commits intomockito:release/3.xfrom
kluever:fix-1815
Nov 7, 2019
Merged

Add Duration overloads. Fixes #1815#1818
TimvdLippe merged 2 commits intomockito:release/3.xfrom
kluever:fix-1815

Conversation

@kluever
Copy link
Copy Markdown
Contributor

@kluever kluever commented Nov 6, 2019

Add new java.time.Duration-based public APIs to Mockito, After, and Timeout and deprecate the corresponding long-based public APIs.
Plumb those Duration instances through the internals of Mockito.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Nov 6, 2019

Codecov Report

Merging #1818 into release/3.x will decrease coverage by 0.04%.
The diff coverage is 84.37%.

Impacted file tree graph

@@                Coverage Diff                @@
##             release/3.x    #1818      +/-   ##
=================================================
- Coverage          86.76%   86.71%   -0.05%     
- Complexity          2490     2492       +2     
=================================================
  Files                311      311              
  Lines               6542     6549       +7     
  Branches             821      821              
=================================================
+ Hits                5676     5679       +3     
- Misses               670      674       +4     
  Partials             196      196
Impacted Files Coverage Δ Complexity Δ
...java/org/mockito/internal/exceptions/Reporter.java 93.51% <ø> (ø) 93 <0> (ø) ⬇️
src/main/java/org/mockito/Mockito.java 96.87% <100%> (+0.1%) 44 <4> (+2) ⬆️
...nternal/verification/VerificationOverTimeImpl.java 92.1% <100%> (ø) 16 <5> (ø) ⬇️
...erification/VerificationWrapperInOrderWrapper.java 100% <100%> (ø) 6 <0> (ø) ⬇️
src/main/java/org/mockito/verification/After.java 77.77% <50%> (-22.23%) 4 <2> (ø)
...rc/main/java/org/mockito/verification/Timeout.java 69.23% <60%> (-12.59%) 5 <3> (ø)
src/main/java/org/mockito/internal/util/Timer.java 86.66% <90.9%> (+0.95%) 8 <7> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68bc593...1a6f4b5. Read the comment docs.

Copy link
Copy Markdown
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have some additional integration tests that use the new timeout method? E.g. add some new tests like

@Test
public void should_verify_with_timeout() {
// when
async.runAfter(50, callMock('c'));
async.runAfter(500, callMock('c'));
// then
verify(mock, timeout(200).only()).oneArg('c');
verify(mock).oneArg('c'); //sanity check
}

@TimvdLippe TimvdLippe merged commit 9603fb2 into mockito:release/3.x Nov 7, 2019
TimvdLippe added a commit that referenced this pull request Dec 16, 2019
TimvdLippe added a commit that referenced this pull request Dec 16, 2019
pull bot pushed a commit to scope-demo/mockito that referenced this pull request Dec 16, 2019
epeee pushed a commit to epeee/mockito that referenced this pull request Jun 22, 2020
epeee pushed a commit to epeee/mockito that referenced this pull request Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants