Add new comment

Submitted by Uma Lade (not verified) on Thu, 06/05/2010 - 17:47
 

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

The content of this field is kept private and will not be shown publicly.

Full HTML

  • Lines and paragraphs break automatically.
  • You can caption images (data-caption="Text"), but also videos, blockquotes, and so on.
  • Web page addresses and email addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <cpp>, <css>, <html5>, <java>, <javascript>, <php>, <sql>, <xml>. The supported tag styles are: <foo>, [foo].
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.