Mocks, Stubs and Spies with Mockito - JUnit Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ม.ค. 2025
  • Learn about the differences between a mock, a stub, and a spy for the purposes of creating test doubles with the Mockito framework.
    In this video, I have used an example to demonstrate when we would want to use each of the different test doubles and the unique benefits they can offer when automation testing.
    The source code from this video is available on GitHub: github.com/4ne...
    Comment, like and subscribe for more content on Java and software engineering.
    Visit my website to also see my blogs: aneesh.co.uk

ความคิดเห็น • 57

  • @akashg9863
    @akashg9863 23 วันที่ผ่านมา +1

    Your have arranged the content very well. The definitions are easy with good examples. I haven't got a chance to use Spy in real world.
    Thanks for creating this. I will recommend this and the previous video as a starter for anyone who is new to Mockito.

    • @AneeshMistry
      @AneeshMistry  19 วันที่ผ่านมา

      Thank you so much! It means a lot to me, I am glad it helped

  • @pawebugiel319
    @pawebugiel319 ปีที่แล้ว +5

    Very well 15 minutes, concise, informative, without unnecessary digressions. Good job.

  • @miraclechukwuma7760
    @miraclechukwuma7760 2 ปีที่แล้ว +13

    I can't tell you how many videos I had to watch before I saw yours. This is a really great content, thanks a lot.

  • @blooming_saffron
    @blooming_saffron 10 หลายเดือนก่อน +1

    This is great, exactly what I was looking for. Great quality, thanks a lot!

    • @AneeshMistry
      @AneeshMistry  10 หลายเดือนก่อน

      Thank you so much for saying!

  • @chayanmukherjee16
    @chayanmukherjee16 13 วันที่ผ่านมา

    Nice concise explanation!

  • @itsahandle
    @itsahandle 3 ปีที่แล้ว +3

    Underrated channel and video you deserve more views and subs! Subbed!

  • @emmanuelpena3000
    @emmanuelpena3000 ปีที่แล้ว

    I was so confused watching other videos. Thank you!

    • @AneeshMistry
      @AneeshMistry  ปีที่แล้ว

      I’m glad it could help! Thank you!

  • @cs-ope
    @cs-ope ปีที่แล้ว +1

    Absolutely top notch content!

  • @sasherazi
    @sasherazi 22 วันที่ผ่านมา +1

    top quality content

    • @AneeshMistry
      @AneeshMistry  19 วันที่ผ่านมา

      Thank you so much!

  • @nekaneolaguibel4717
    @nekaneolaguibel4717 2 ปีที่แล้ว +2

    Super easy to understand, thank you!!!

  • @loveyouself5389
    @loveyouself5389 8 หลายเดือนก่อน +1

    Very useful, please upload more videos to test coroutines, flows and new android concepts.

  • @prakashkakade8945
    @prakashkakade8945 2 ปีที่แล้ว +1

    I like the way you are explaining topic

  • @hassellvinny
    @hassellvinny ปีที่แล้ว

    Very clear tutorial - thank you!

  • @amusedhermit4672
    @amusedhermit4672 ปีที่แล้ว +1

    bro you are hella underrated you deserve at least 300k subs.

    • @AneeshMistry
      @AneeshMistry  ปีที่แล้ว +1

      Thank you so much! New videos will be coming soon :)

  • @LeonardoBPG
    @LeonardoBPG 2 ปีที่แล้ว

    Excellent content! Great work!

  • @paulndibe250
    @paulndibe250 2 ปีที่แล้ว

    Great content, well explained with explained. Thanks

  • @CenturionDobrius
    @CenturionDobrius ปีที่แล้ว +1

    Thanks for everything you do, as those lessons are the best I've ever found so far.
    Please consider Jackson (json) course once you'll have time :)

    • @AneeshMistry
      @AneeshMistry  ปีที่แล้ว

      Thank you! I am working on some infrastructure videos now but can do some json work in the future as well

  • @techsolaris1
    @techsolaris1 2 ปีที่แล้ว

    Great content! Congrats!

  • @szopsop
    @szopsop 2 ปีที่แล้ว

    That was amazing. Thank you so much!

  • @SushilKumar-pq5ff
    @SushilKumar-pq5ff 3 ปีที่แล้ว +1

    Thanks for nice explanation.

  • @guyhouri7590
    @guyhouri7590 2 ปีที่แล้ว

    great video. explained it really well. thank you !!

  • @PJKirby
    @PJKirby 2 ปีที่แล้ว

    Great video!

  • @cal1314
    @cal1314 2 ปีที่แล้ว

    Good stuff!

  • @pranavmahajan4190
    @pranavmahajan4190 3 ปีที่แล้ว +1

    Your content is really good. Please cover mockito for repository and entitymanager. Thanks for the nice video.

    • @AneeshMistry
      @AneeshMistry  3 ปีที่แล้ว +2

      Hey Pranav, sure! Will let you know when this is published

    • @pranavmahajan4190
      @pranavmahajan4190 3 ปีที่แล้ว

      @@AneeshMistry - Thanks so much!

  • @user-we9qo4kh2w
    @user-we9qo4kh2w 2 ปีที่แล้ว +2

    Your content is amazing! Could you create some content for Dependency injection, setter injections, how to create a simple app using Spring? Thanks!

    • @AneeshMistry
      @AneeshMistry  2 ปีที่แล้ว

      Hey, thank you! I have created a Spring series on creating a REST API. But I will also do some videos on dependency injection/setter injections in the near future
      th-cam.com/video/c9iKKAZY00g/w-d-xo.html

  • @austinrandall4412
    @austinrandall4412 2 ปีที่แล้ว

    Thank you!

  • @VVV-xf5vl
    @VVV-xf5vl 2 ปีที่แล้ว

    Great, thanx.

  • @shreyasaxena5169
    @shreyasaxena5169 2 ปีที่แล้ว

    Hi Aneesh, m getting NPE every time I use mock. Can you please help?

    • @AneeshMistry
      @AneeshMistry  2 ปีที่แล้ว

      Hey, please share a link to the repo with the null pointer and I can take a look

  • @alfredpennyworth5768
    @alfredpennyworth5768 2 ปีที่แล้ว

    What if numberOfSubscribers is private ? How to test sendNewsLetter ? How to mock this method ?

    • @AneeshMistry
      @AneeshMistry  2 ปีที่แล้ว

      Hi Alfred, please see my video on testing private methods: th-cam.com/video/EUXesPg7qOo/w-d-xo.html