I'm building a WAR using Spring 3.1.1.RELEASE, Hibernate 4.1.0.Final, JPA 2.0, and deploying to JBoss 7.1.1.Final. I'm noticing some errors that occur in my JBoss environment that don't occur in my unit tests and I want to eliminate a couple of factors. Is there a way to mock the JBoss transaction manager when running Spring JUnit tests? I use this application context when I deploy my application:
but in my JUnit environment, I use a different context:
I would like my tests to mirror as closely as possible what will happen when I deploy. Thanks, -
subject: How do I mock the JBoss 7 JTA transaction manager in JUnit?