From bc3623b532d9d1ea5af9d3df764749c13959d0aa Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Fri, 27 Jan 2017 12:40:27 +0100 Subject: [PATCH] #253 - Removed custom Neo4j infrastructure setup in favor of Boot 1.5's auto-configuration. --- .../neo4j/ActorRepositoryIntegrationTest.java | 29 ++----------------- 1 file changed, 3 insertions(+), 26 deletions(-) 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 91dcd903..2d7963e4 100644 --- a/neo4j/example/src/test/java/example/springdata/neo4j/ActorRepositoryIntegrationTest.java +++ b/neo4j/example/src/test/java/example/springdata/neo4j/ActorRepositoryIntegrationTest.java @@ -20,16 +20,10 @@ 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.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -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; /** @@ -43,25 +37,8 @@ import org.springframework.transaction.annotation.Transactional; @Transactional public class ActorRepositoryIntegrationTest { - @Configuration - @EnableTransactionManagement - @EnableNeo4jRepositories - static class ExampleConfig { - - @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); - } - } + @SpringBootApplication + static class ExampleConfig {} @Autowired ActorRepository actorRepository;