Perhaps your DAO is also tagged @Transactional ? If so, then the problem is: the transactional ability at another level does not know about your local transaction configuration. If repository.update(article) is @Transactional , it may or may not start a new transaction (depending on the value of the propagation attribute), but it will complete the transaction after execution, and there is nothing your test method can do to intercept that.
This is one of the reasons why transactions should be started at the service level, and not at the DAO level.
(If it is not, I humbly apologize)
Sean Patrick Floyd
source share