#253 - Removed custom Neo4j infrastructure setup in favor of Boot 1.5's auto-configuration.

This commit is contained in:
Oliver Gierke
2017-01-27 12:40:27 +01:00
parent 4cf37f3527
commit bc3623b532

View File

@@ -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;