Jun 8th, 2009, 02:22 AM
Spring unit testing EJB with mappedName
I have an EJB with a reference to another EJB through @EJB annotation +mappedName attribute.
When I try to unit test the EJB out-of-container using SpringJUnit4ClassRunner, autowiring the bean causes Spring to try to look up the referenced bean from JNDI. Spring documentation states this is done by default because of the mappedName attribute.
Is there a nice way to change this behaviour, to inject a bean from application context and not lookup from JNDI? Or what would be the proper workaround?
Feb 9th, 2012, 08:20 AM
I am also struck on same problem.
Did you find any solution so far.