stubbing

A collection of 1 posts

A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
May 21, 2009 factoryBean mockito proxy spring spy stub stubbing unit testing

Mockito' spy() method and Spring

Mockito is a mocking framework (see Two different mocking approaches) that is an offshoot of EasyMock. Whatever the mocking framework one uses, a common feature is the ability to mock interfaces, through the JDK Proxy class. This is well and nice, but one has to explicitly mock every method that one wants to use in the course of the test. What if I want to mock an already existing implementation, with some methods providing behaviours that suit me ? Today, I ran across this case: I had a legacy

Nicolas Fränkel
A Java geek © 2008-2025
v. f32325969478592b3c56e2566b1da38f32e70c50/10035795030
Latest Posts