Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
4.2 GA (Ingalls)
-
Spring Boot 1.5.1, SDN 4.2 with STS 3.8.1 IDE. I use JUnit 4.12 for integration testing
Description
I wanted to test my SDN 4.2 repositories, specifically how to create new object/nodes. As this kind of integration tests are transactional ones, Spring automatically try to rollback the transactions.
During the rollback I get an exception of org.neo4j.ogm.exception.TransactionManagerException: Transaction is not current for this thread.
I used debug option for logging to see what's going on behind the scenes. The first relevant log item was:
2017-02-21 12:11:18.941 DEBUG 5604 --- [ main] o.s.d.n.t.Neo4jTransactionManager : Opened new Session [[email protected]] for Neo4j OGM transaction
Later on:
2017-02-21 12:11:19.559 DEBUG 5604 — [ main]
o.s.d.n.t.Neo4jTransactionManager : Rolling back Neo4j transaction [null] on Session [[email protected]]
Finally I got a warning before the eception:
2017-02-21 12:11:19.566 WARN 5604 --- [ main] o.s.test.context.TestContextManager : Caught exception while allowing TestExecutionListener [org.springframew[email protected]3e57cd70] to process 'after' execution for test: method [public void hu.bookandwalk.RepositoryTests.ShouldInsertUser()], instance [[email protected]], exception [null]
Consequently this test fail, although the @Test annotated method runs as expected delivering the expected result.
Using transactional integration testing does not work