Comments (1)
@saden1 Yeah spies are kinda specialized mocks. And the way mockito does this is to perform a shallow copy of fields from the original instance.
Also about proxying, unfortunately some objects especially generated ones usually cannot be subclassed, or sometime cannot be instantiated. Reasons vary. Anyway that's why we introduced the AdditionalAnswers.delegateTo()
answer for such cases.
I'm closing the issue as it's somehow expected that exotic object / instances cannot be used using the regular API, hence the additional answer.
from mockito.
Related Issues (20)
- 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
- AdditionalMatchers.and() and or() swap matcher order HOT 5
- Failing while building mockito-inline version 4.6.1 using ./gradlew build (org.mockito:mockito-inline:4.6.1) HOT 1
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.