Giter Site home page Giter Site logo

Comments (8)

mockitoguy avatar mockitoguy commented on May 22, 2024

Hey,

Perhaps Mockito is too aggressive with this validation. The thing is that this code could break if you stub some of those methods. @bric3, thoughts?

Thanks for reporting! Can you update your code and add Serializable / default constructor?

from mockito.

bric3 avatar bric3 commented on May 22, 2024

I just experienced the same issue when I wanted to test our custom DSL API on my current project. I believe there was some issue sometime ago before we moved to github about serialization, it may relate to deep stubs.

from mockito.

 avatar commented on May 22, 2024

https://code.google.com/p/mockito/issues/detail?id=399 right?

I don't really understand this validation - if I have no interest in my code being serializable nor serializing a mock/stub; why do I have to make it so (and add default constructors, allowing partially constructed objects) just to use deep stubs? Shouldn't I have to opt-in if I need/want my deep stubs to be serializable or am I missing something?

from mockito.

joerg-pfruender-hp avatar joerg-pfruender-hp commented on May 22, 2024

@szczepiq Hi, for one occurence I was able to implement a default constructor. For another occurence, it did not feel sensible to add a default constructor. I changed this and mocked all used method calls manually. For me it's ok now.
btw: Thank you very much for sharing and caring for mockito!

from mockito.

bric3 avatar bric3 commented on May 22, 2024

For some reason the deep stub code was enabling children stubs to be always serializable which doesn't make sense. In the plane I crafted a fix. I'll push it asap.

from mockito.

bric3 avatar bric3 commented on May 22, 2024

It should be fixed in 1.10.8

from mockito.

 avatar commented on May 22, 2024

Excellent, thanks @bric3 ! Let me take this chance to add that Mockito is an excellent piece of software and a near-perfect mocking library IMO - all of your efforts are highly appreciated :) I was at a workshop with Michael Feathers recently and was asking him whether he planned to update his book Working Effectively with Legacy Code to reflect the invent of modern (non-strict!) mocking frameworks such as Mockito as in my opinion they have revolutionized dependency-breaking and bringing legacy code under test. No luck, but maybe someone should write a new updated such book :)

from mockito.

mockitoguy avatar mockitoguy commented on May 22, 2024

Hey,

1.10.8 was released to Bintray/jcenter. For some reason, maven central sync
didn't work :(

What do you think needs to be fixed so that mockito is perfect? :)

On Fri, Oct 10, 2014 at 5:33 AM, Chad [email protected] wrote:

Excellent, thanks @bric3 https://github.com/bric3 ! Let me take this
chance to add that Mockito is an excellent piece of software and a
near-perfect mocking library IMO - all of your efforts are highly
appreciated :) I was at a workshop with Michael Feathers recently and was
asking him whether he planned to update his book Working Effectively with
Legacy Code to reflect the invent of modern (non-strict!) mocking
frameworks such as Mockito as in my opinion they have revolutionized
dependency-breaking and bringing legacy code under test. No luck, but maybe
someone should write a new updated such book :)

Reply to this email directly or view it on GitHub
#99 (comment).

Szczepan Faber
Core dev@gradle; Founder@mockito

from mockito.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.