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?