title: How to unit-test that spring @Transactional is present?
body: <p>I wonder how can I make unittest to ensure that all my DAOs have <code>propagation=MANDATORY</code>.
  I have implemented just a unit test to call <code>dao.getAll()</code> without a transaction, and fail if there was no exception. But this is not kind of full test, I can't check it for all child methods.</p>
  
  <p>That's what I have now:</p>
  
  <pre><code>String[] beanNamesForType = applicationContext.getBeanNamesForType(Dao.class);
  for (String beanName : beanNamesForType) {
      Dao bean = (Dao) applicationContext.getBean(beanName);
  
      try {
          bean.getAll();
          fail();
      } catch (IllegalTransactionStateException ex) {
          //This is expected
      }
  }
  </code></pre>
  
  <p>Are there possibility just to check that all DAO methods are proxified with needed transaction propagation? Maybe to use reflection?</p>