I am working on a unit test that passes information through a DAO to an Oracle database and then extracts it and verifies that everything has not changed.
There are other unit tests in the test class, and at the top of the class:
@TransactionConfiguration (defaultRollback = true)
I would like to know how I can remove @NotTransactional. I do not specify Transactional in the class, so by default such tests should not be like that. Since this is his own test, I do not know if the correct @BeforeTransaction (or After) annotations will be.
the biggest problem is that without @NotTransactional it seems that unsubscribe () function is not running. (basket flag does not change.)
Restarting the test with @rollback = false and @NonTransactional, I see that the trash flag is correctly set to true in the database after the test is completed.
@RunWith (SpringJUnit4ClassRunner.class) @TransactionConfiguration (defaultRollback = true) public class DatabaseTest { @Autowired (required = true) private FooDao<Foo> fooDao; @Autowired (required = true) private FooService fooService;
Thanks!
source share