Reset Neo4j tests to use the default driver again

This commit resets the artificial use of the http driver now the bolt
driver doesn't check if the connection to the Neo4J server is valid
on startup.

See neo4j/neo4j-java-driver#380

Closes gh-9500
pull/9855/merge
Stephane Nicoll 7 years ago
parent 2109cab28b
commit 996e6bf48c

@ -94,7 +94,7 @@ public class MixedNeo4jRepositoriesAutoConfigurationTests {
private void load(Class<?> config, String... environment) { private void load(Class<?> config, String... environment) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
TestPropertyValues.of(environment).and("spring.datasource.initialize", "false") TestPropertyValues.of(environment).and("spring.datasource.initialize", "false")
.and("spring.data.neo4j.uri", "http://localhost:8989").applyTo(context); .applyTo(context);
context.register(config); context.register(config);
context.register(DataSourceAutoConfiguration.class, context.register(DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class, HibernateJpaAutoConfiguration.class,

@ -80,8 +80,7 @@ public class Neo4jDataAutoConfigurationTests {
@Test @Test
public void customNeo4jTransactionManagerUsingProperties() { public void customNeo4jTransactionManagerUsingProperties() {
load(null, "spring.data.neo4j.uri=http://localhost:8989", load(null, "spring.transaction.default-timeout=30",
"spring.transaction.default-timeout=30",
"spring.transaction.rollback-on-commit-failure:true"); "spring.transaction.rollback-on-commit-failure:true");
Neo4jTransactionManager transactionManager = this.context Neo4jTransactionManager transactionManager = this.context
.getBean(Neo4jTransactionManager.class); .getBean(Neo4jTransactionManager.class);
@ -110,8 +109,6 @@ public class Neo4jDataAutoConfigurationTests {
@Test @Test
public void usesAutoConfigurationPackageToPickUpDomainTypes() { public void usesAutoConfigurationPackageToPickUpDomainTypes() {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
TestPropertyValues.of("spring.data.neo4j.uri=http://localhost:8989")
.applyTo(this.context);
String cityPackage = City.class.getPackage().getName(); String cityPackage = City.class.getPackage().getName();
AutoConfigurationPackages.register((BeanDefinitionRegistry) this.context, AutoConfigurationPackages.register((BeanDefinitionRegistry) this.context,
cityPackage); cityPackage);
@ -125,16 +122,14 @@ public class Neo4jDataAutoConfigurationTests {
@Test @Test
public void openSessionInViewInterceptorCanBeDisabled() { public void openSessionInViewInterceptorCanBeDisabled() {
load(null, "spring.data.neo4j.uri=http://localhost:8989", load(null, "spring.data.neo4j.open-in-view:false");
"spring.data.neo4j.open-in-view:false");
assertThat(this.context.getBeansOfType(OpenSessionInViewInterceptor.class)) assertThat(this.context.getBeansOfType(OpenSessionInViewInterceptor.class))
.isEmpty(); .isEmpty();
} }
@Test @Test
public void eventListenersAreAutoRegistered() { public void eventListenersAreAutoRegistered() {
load(EventListenerConfiguration.class, load(EventListenerConfiguration.class);
"spring.data.neo4j.uri=http://localhost:8989");
Session session = this.context.getBean(SessionFactory.class).openSession(); Session session = this.context.getBean(SessionFactory.class).openSession();
session.notifyListeners(new PersistenceEvent(null, Event.TYPE.PRE_SAVE)); session.notifyListeners(new PersistenceEvent(null, Event.TYPE.PRE_SAVE));
verify(this.context.getBean("eventListenerOne", EventListener.class)) verify(this.context.getBean("eventListenerOne", EventListener.class))

@ -218,11 +218,6 @@
<artifactId>mongodb-driver-reactivestreams</artifactId> <artifactId>mongodb-driver-reactivestreams</artifactId>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-http-driver</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.skyscreamer</groupId> <groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId> <artifactId>jsonassert</artifactId>

@ -1,5 +0,0 @@
#
# This is a temporary override until the Neo4j bolt driver stops validating
# the connection on startup, see https://github.com/neo4j/neo4j-java-driver/issues/380
#
spring.data.neo4j.uri=http://localhost:8989
Loading…
Cancel
Save