Unit Testing with Mock Objects (and Spring)

I was looking into some information on how to do unit testing using mock objects. Since I’m using Spring, I’m also considering this into the equation.

So far, I have found some nice articles, like this one linked from TheServerSide, which talks about unit testing and mock objects in general, and provide some examples.

I have also found several mock object libraries:

I’m wondering what people have done in this area. It seems that using mock objects is an ideal match for unit testing, and something that should be more thoroughly integrated.

2 thoughts on “Unit Testing with Mock Objects (and Spring)

  1. Spring does have its own set of Mock objects in the org.springframework.mock package.. they don’t cover everything that the more comprehensive libraries cover though.

  2. Im ussing Junit, it works fine!!!
    actualy you cant mock private methods with junit, but i think that this is correct, according separation of concerns..

Leave a Reply