This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Am trying to mock local object by using Mockito framework ,that is being created from the spring application context .But every time when am running the application by TestNG its failed to replace the original object by the mocked object.
Here is the original class's code spinets:
Jeanne Boyarsky wrote:
This part of the code is a problem. You aren't injecting the mock anywhere. You are still referring to the Spring context.
In general, I wonder why you are using getBean() directly rather than having it injected.
Jeanne ,,,you are correct , this is the original class.
In my test class am mocking the MusicEAO class by the mockito framework by using the @Mock annotation.But the original object is not getting mocked....