This is my stateless bean:
@Stateless
public class Finder {
@PersistenceContext(unitName = "production")
EntityManager em;
[...]
}
It explicitly defines that the name of persistence unit is production
. This unit is configured in persistence.xml
, and everything is fine. When I'm unit testing this class I have to use another persistence unit, with different set of properties and configuration settings. How should I organize it? Create another <persistence-unit>
element in persistence.xml
? Does any best practice exist for this?