Hello.
I'm in doubt about JMock using.
The scenario is described as follows:
I have a class implemented as a Service with EntityManager injected by spring IoC.
I'll focus on executeInvite method that uses an internal (private) method called getRemainingStatusInstance which also make using of EntityManager to recover an instance of an Entity to set a valid status for an Invitation Entity.
The problem comes when I'm using a
Test class using JMock which can be viewed at a second portion of code as follows.
First portion of code (the service implementation)
And now I have the second portion of code which lists my unit test using JMock:
Well...
I'd like if I really need to do that hard work writing the whole behavior that happens at my service implementation when writing my unit test ?
Does it have a simplified way to that?
Am I writing my unit test in wrong way?
Any help will be appreciated.
Even if there isn't a straightforward answer, does any body could discuss it at this post to help me evolve the concept when using JMock?
Thanks.