Commit 996e6bf4 authored by Stephane Nicoll's avatar Stephane Nicoll

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
parent 2109cab2
......@@ -94,7 +94,7 @@ public class MixedNeo4jRepositoriesAutoConfigurationTests {
private void load(Class<?> config, String... environment) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
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(DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class,
......
......@@ -80,8 +80,7 @@ public class Neo4jDataAutoConfigurationTests {
@Test
public void customNeo4jTransactionManagerUsingProperties() {
load(null, "spring.data.neo4j.uri=http://localhost:8989",
"spring.transaction.default-timeout=30",
load(null, "spring.transaction.default-timeout=30",
"spring.transaction.rollback-on-commit-failure:true");
Neo4jTransactionManager transactionManager = this.context
.getBean(Neo4jTransactionManager.class);
......@@ -110,8 +109,6 @@ public class Neo4jDataAutoConfigurationTests {
@Test
public void usesAutoConfigurationPackageToPickUpDomainTypes() {
this.context = new AnnotationConfigApplicationContext();
TestPropertyValues.of("spring.data.neo4j.uri=http://localhost:8989")
.applyTo(this.context);
String cityPackage = City.class.getPackage().getName();
AutoConfigurationPackages.register((BeanDefinitionRegistry) this.context,
cityPackage);
......@@ -125,16 +122,14 @@ public class Neo4jDataAutoConfigurationTests {
@Test
public void openSessionInViewInterceptorCanBeDisabled() {
load(null, "spring.data.neo4j.uri=http://localhost:8989",
"spring.data.neo4j.open-in-view:false");
load(null, "spring.data.neo4j.open-in-view:false");
assertThat(this.context.getBeansOfType(OpenSessionInViewInterceptor.class))
.isEmpty();
}
@Test
public void eventListenersAreAutoRegistered() {
load(EventListenerConfiguration.class,
"spring.data.neo4j.uri=http://localhost:8989");
load(EventListenerConfiguration.class);
Session session = this.context.getBean(SessionFactory.class).openSession();
session.notifyListeners(new PersistenceEvent(null, Event.TYPE.PRE_SAVE));
verify(this.context.getBean("eventListenerOne", EventListener.class))
......
......@@ -218,11 +218,6 @@
<artifactId>mongodb-driver-reactivestreams</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-http-driver</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
......
#
# 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment