I've a similar case, a service bean with a member of daoBean annotated with @EJB.
I've written EJB3unit test for the serviceBean, and mocked the daoBean. but the mock object (dateManipulatorMock in your example) not getting injected to the main class (StringManipulator in your example).
The getMock() returns a proxy object, but its not being set to the main class, so its always null, so Im getting nullpointerexception when I call the actual method.
I've a similar case, a service bean with a member of daoBean annotated with @EJB.
I've written EJB3unit test for the serviceBean, and mocked the daoBean. but the mock object (dateManipulatorMock in your example) not getting injected to the main class (StringManipulator in your example).
The getMock() returns a proxy object, but its not being set to the main class, so its always null, so Im getting nullpointerexception when I call the actual method.
Could you please tell me if Im missing anything.
Thanks & Regards
Uma