Comments (5)
I still like the after
method, can't we just keep it as an alias ?
from mockito.
In this case, I'd rather have a single opinionated method (unless I'm convinced otherwise :).
How about this:
mock(foo, after(10).times(2)).bar()
VS
mock(foo, during(10).times(2)).bar()
It feels that 'after' has higher chance of producing ambiguous looking test code.
from mockito.
Also, 'after' can be interpreted as:
- wait given amount of time
- then validate invocations that happen after the time period (e.g. excluding invocations that happened during the time).
AFAIR the implementation does not work this way. The impl expects the invocation(s) 'during' this time :)
from mockito.
ok I agree, I now remember what this call did. Never mind my original comment.
However, looking at your example, it would feel better if an alias could support TimeUnit
.
mock(foo, during(10).times(2)).bar()
mock(foo, during(10, SECONDS).times(2)).bar()
from mockito.
Yeah, this kind of alias makes perfect sense.
from mockito.
Related Issues (20)
- Field with generics is not injected using @InjectMocks HOT 1
- Possible race condition HOT 3
- MissingMethodInvocationException is thrown when mocking native method in 5.x HOT 1
- ByteBuddy agent fails to install on GraalVM HOT 1
- Incorrect documentation for RETURNS_MOCKS HOT 3
- Mockito.only() points to the wanted call as unwanted if it is the first being called.
- Mockito vs EasyMock performance HOT 4
- @Mock and MockedConstruction
- application HOT 1
- In TypeBasedCandidateFilter.isCompatibleTypes -> ClassCastException: class TypeVariableImpl cannot be cast to class Class HOT 9
- Spy does not see method called in feedback call HOT 3
- Mockito.mock(...) does not work inside an Arquillian integration test anymore HOT 1
- Feature Request: MockedConstruction needs a setInitializer method
- ArgumentMatcher like assertArg() for multiple different calls? HOT 3
- Mockito does not work on Java 21 HOT 3
- Mockito.mock() not mocking the Class in Java 17 HOT 1
- ArgumentMatcher for one property
- Tests failures after adding mockito-inline on Java 21
- springjpa+junit5+mockito+querydsl
- ungraceful failure from instrumented code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mockito.