title: How to simulate an exception while updating to test the spring transaction management?
body: <p>I have under the same spring managed transaction an array of updates as below:</p>
  
  <pre><code>someRepositoryA.updateEntityA(...)
  someRepositoryB.updateEntityB(...)
  someRepositoryC.updateEntityC(...)
  </code></pre>
  
  <p>How can I simulate that <code>someRepositoryB.updateEntityB(...)</code> throws an <code>Exception</code>? That will allow me to see that the changes made by A were revoked. Since I will test the transaction I cannot mock the repository, but I will use some in-memory database.</p>