diff --git a/neo4j/example/pom.xml b/neo4j/example/pom.xml index cc6afdfc..ffc57ec9 100644 --- a/neo4j/example/pom.xml +++ b/neo4j/example/pom.xml @@ -7,7 +7,8 @@ Spring Data Neo4j - Example - 2.0.0-M04 + 2.1.0-RC1 + Ingalls-BUILD-SNAPSHOT diff --git a/neo4j/example/src/test/java/example/springdata/neo4j/ActorRepositoryIntegrationTest.java b/neo4j/example/src/test/java/example/springdata/neo4j/ActorRepositoryIntegrationTest.java index 797348e7..91dcd903 100644 --- a/neo4j/example/src/test/java/example/springdata/neo4j/ActorRepositoryIntegrationTest.java +++ b/neo4j/example/src/test/java/example/springdata/neo4j/ActorRepositoryIntegrationTest.java @@ -20,12 +20,14 @@ import static org.junit.Assert.*; import org.junit.Test; import org.junit.runner.RunWith; +import org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver; import org.neo4j.ogm.session.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.data.neo4j.config.Neo4jConfiguration; import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories; +import org.springframework.data.neo4j.transaction.Neo4jTransactionManager; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.Transactional; @@ -37,18 +39,27 @@ import org.springframework.transaction.annotation.Transactional; * @author Oliver Gierke */ @RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration +@SpringBootTest @Transactional public class ActorRepositoryIntegrationTest { @Configuration @EnableTransactionManagement @EnableNeo4jRepositories - static class ExampleConfig extends Neo4jConfiguration { + static class ExampleConfig { - @Override - public SessionFactory getSessionFactory() { - return new SessionFactory("example.springdata.neo4j"); + @Bean + SessionFactory getSessionFactory() { + + org.neo4j.ogm.config.Configuration configuration = new org.neo4j.ogm.config.Configuration(); + configuration.driverConfiguration().setDriverClassName(EmbeddedDriver.class.getName()); + + return new SessionFactory(configuration, "example.springdata.neo4j"); + } + + @Bean + Neo4jTransactionManager transactionManager(SessionFactory factory) { + return new Neo4jTransactionManager(factory); } }