0

Looking other technologies than Java, I came accross the 'Auto Mocking Container' strategy.

An easy to use integration of Mockito and Spring (and for TestNG, since it's my preference over Junit) would be very handy

Unhopefully, I haven't found anything like it for Spring. But is there something out there, I haven't found?

4
  • This sounds at least going in the same direction... stackoverflow.com/questions/10247297/… Commented Mar 19, 2016 at 18:16
  • @Florian : i 'll take a look, thanks Commented Mar 21, 2016 at 7:35
  • This wil probably be officious comment but please don't do this unless you are absolutely sure it's a good idea. Mocking has its place but serious overuse particular automated use will lead to brittle low value high maintenance tests that will make the rest of your team hate you (believe it took me many years to learn this). Don't underestimate integration tests or real unit tests (a proper unit test in isolation will rarely need mock since you can just override methods as you control the class under test).
    – Adam Gent
    Commented Mar 21, 2016 at 12:12
  • Integrating Spring with a mocking framework sounds like overkill. What you probably need is some kind of rule for Mockito which is equivalent to JMock's @Mock or @Auto annotations. If you need to add Spring into the equation then you may not making best use of mocking.
    – sisyphus
    Commented Mar 21, 2016 at 19:36

0