title: How do I mock a TransactionManager in a JUnit test, (outside of the container)?
body: <p>I'm using Spring 3.1.0.RELEASE, JUnit 4.8.1, and ultimately deploying my application to a JBoss 4.2 server (I know, I know).  As part of setting up my unit test, I have this in my Spring test application context ...</p>
  
  <pre><code>&lt;bean id="transactionManager"  
      class="org.springframework.transaction.jta.JtaTransactionManager"&gt;
          &lt;property name="userTransactionName"&gt;
          &lt;value&gt;UserTransaction&lt;/value&gt;
      &lt;/property&gt; 
  &lt;/bean&gt;
  </code></pre>
  
  <p>Of course, right now this fails because there is nothing bound to the JNDI name, "UserTransaction."  How do I mock a transaction manager?  I'm using the org.mockejb framework but an open to any suitable mocking frameworks.</p>