-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Viktor Kostov opened SPR-13723 and commented
According to a documentation (http://docs.spring.io/spring/docs/current/spring-framework-reference/html/integration-testing.html#testcontext-tx-enabling-transactions), should be possible to flush current session to avoid false positive in a test. Not sure about root cause of the problem, but it seems that sessionFactory.getCurrentSession().flush(); creates new transaction, instead of using existing one.
Here is a small sample that demonstrates a problem: https://github.com/sk8ter/demo
Test should fail in an example of project above.
Affects: 4.2.3
Reference URL: http://stackoverflow.com/questions/33905773/spring-boot-test-test-passes-but-should-not-false-positive
Issue Links:
- Update Testing chapter regarding avoiding false positives with JPA [SPR-9032] #13671 Update Testing chapter regarding avoiding false positives with JPA ("duplicates")
Referenced from: commits 17df02d