I'm trying to write JUnit tests for a stateless session bean that has an injected EntityManager:
@Stateless
public class MyServiceBean implements MyService, ... {
@PersistenceContext
private EntityManager em;
....
Of course, without doing anything, em remains null in the flow of the test...
The tests should run standalone (NOT in a Java EE container).
How do I do that please? (simple solutions will be most appreciated :-)