What framework should I use to mock an EJB using Spring 3, EJB 2.0?
posted 3 years ago
I'm using Spring 3.1.0.RELEASE and JUnit 4.8.1. I want to mock a deployment of a stateless session EJB but not sure what framework I should be using given the following. I want to test my Spring controller, which looks up an EJB using this code …
I set up the Spring test like so …
The EJB I'm deploying is in a JAR file that contains a META-INF/ejb-jar.xml file that declares my EJBs (as opposed to annotations) like so …
Given this, what framework should I use for mocking the EJB container and binding my EJB to the proper JNDI name? I looked at Arquillian, but it seems it requires you to declare "@RunWith" at the top of your test, and JUnit only allows one "@RunWith" declaration.