Did you had the problem your mock must act like a bean? And you could not create the object with the real implementation? And the interface was too large, so you would not create a innerclass for the test? I had this problem too. I solved it with the answer in mockito.

Java, Test Driven Development, Testing
answer, ejb, Java, Mocking, Mockito, TDD, Test Driven Development
This is a small summarization what the differences are between the different variations creating mocks with mockito.
Null values (default)
Per default, after creating a mock, every method will return null. Just create your mock with:
Sample sample = Mockito.mock(ISample.class);
I think, this is very useful and straight forward. (And based by mockito developers idea, to create very fast a mock for testing). Sometimes it is very difficult to determine an error which was produced through such a null value. For this case it is very practicable to tell mockito, returning SmartNullValues.

Agile, Java, Test Driven Development, Testing
Agile, Java, Mockito, TDD, Test Driven Development, Testing
A few weeks ago, I started using Mockito. Mockito is a mocking framework for Java.
What mockito is able to do:
- mocking interfaces and abstract classes
- mocking concrete classes
- spy real objects
(http://code.google.com/p/mockito)
I liked mockito so much that I decided to present it to you…

Java, Testing
Java, mocking framework, Mockito, Testing