diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/fieldaccess/Neo4jConversionServiceFactoryBean.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/fieldaccess/Neo4jConversionServiceFactoryBean.java index ecdd11598..192edd6ed 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/fieldaccess/Neo4jConversionServiceFactoryBean.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/fieldaccess/Neo4jConversionServiceFactoryBean.java @@ -21,7 +21,7 @@ import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.ConverterFactory; import org.springframework.core.convert.converter.ConverterRegistry; -import org.springframework.core.convert.support.ConversionServiceFactory; +import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.core.convert.support.GenericConversionService; import java.util.Date; @@ -32,7 +32,7 @@ public class Neo4jConversionServiceFactoryBean implements FactoryBean { } File file = new File( path ); // if (!file.isDirectory()) file=file.getParentFile(); - return new DelegatingGraphDatabase(new EmbeddedGraphDatabase(file.getAbsolutePath())); + return new DelegatingGraphDatabase(new org.neo4j.graphdb.factory.GraphDatabaseFactory().newEmbeddedDatabase(file.getAbsolutePath())); } private GraphDatabase createRestGraphDatabase(String url, String username, String password) throws Exception { diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/annotation/relatedtovia/RelatedToViaTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/annotation/relatedtovia/RelatedToViaTests.java index 8d12b9fb1..dd1c4573a 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/annotation/relatedtovia/RelatedToViaTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/annotation/relatedtovia/RelatedToViaTests.java @@ -30,7 +30,7 @@ import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; -import static org.junit.matchers.JUnitMatchers.hasItem; +import static org.hamcrest.CoreMatchers.hasItem; import static org.neo4j.helpers.collection.IteratorUtil.first; import static org.springframework.data.neo4j.SetHelper.asSet; import static org.springframework.data.neo4j.annotation.RelationshipDelegates.getRelationshipNames; diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/config/Neo4jRepositoriesRegistrarIntegrationTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/config/Neo4jRepositoriesRegistrarIntegrationTests.java index 65d0d332d..7ba823050 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/config/Neo4jRepositoriesRegistrarIntegrationTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/config/Neo4jRepositoriesRegistrarIntegrationTests.java @@ -18,7 +18,7 @@ package org.springframework.data.neo4j.config; import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -41,7 +41,7 @@ public class Neo4jRepositoriesRegistrarIntegrationTests { @Bean public GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/conversion/QueryMapResultConverterTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/conversion/QueryMapResultConverterTests.java index 39e181204..fadb91d38 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/conversion/QueryMapResultConverterTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/conversion/QueryMapResultConverterTests.java @@ -33,7 +33,7 @@ import static java.util.Arrays.asList; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; -import static org.junit.matchers.JUnitMatchers.hasItems; +import static org.hamcrest.CoreMatchers.hasItems; import static org.neo4j.helpers.collection.IteratorUtil.asCollection; import static org.neo4j.helpers.collection.MapUtil.map; diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/equality/EqualityTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/equality/EqualityTests.java index 76f2af226..db2d5d7cc 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/equality/EqualityTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/equality/EqualityTests.java @@ -18,7 +18,7 @@ package org.springframework.data.neo4j.equality; import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -116,7 +116,7 @@ public class EqualityTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/fieldaccess/PrefixedDynamicPropertyTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/fieldaccess/PrefixedDynamicPropertyTests.java index 31823beaf..91705daa9 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/fieldaccess/PrefixedDynamicPropertyTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/fieldaccess/PrefixedDynamicPropertyTests.java @@ -19,7 +19,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; -import static org.junit.matchers.JUnitMatchers.hasItems; +import static org.hamcrest.CoreMatchers.hasItems; import java.util.ArrayList; import java.util.HashMap; diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/fieldaccess/PropertyTypeConversionTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/fieldaccess/PropertyTypeConversionTests.java index 4e9bc6ad8..70abbfc37 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/fieldaccess/PropertyTypeConversionTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/fieldaccess/PropertyTypeConversionTests.java @@ -19,7 +19,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -81,7 +81,7 @@ public class PropertyTypeConversionTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } @Override diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/AfterSaveEventTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/AfterSaveEventTests.java index c24dea522..9253db3e2 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/AfterSaveEventTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/AfterSaveEventTests.java @@ -18,7 +18,7 @@ package org.springframework.data.neo4j.lifecycle; import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; @@ -53,7 +53,7 @@ public class AfterSaveEventTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } @Bean diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/BeforeSaveEventTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/BeforeSaveEventTests.java index fc88f3e93..298e57786 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/BeforeSaveEventTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/BeforeSaveEventTests.java @@ -18,7 +18,7 @@ package org.springframework.data.neo4j.lifecycle; import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; @@ -53,7 +53,7 @@ public class BeforeSaveEventTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } @Bean diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/DeleteEventTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/DeleteEventTests.java index ce2eb79bd..f5fa33f28 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/DeleteEventTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/DeleteEventTests.java @@ -19,7 +19,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; @@ -38,7 +38,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.LinkedList; import static org.junit.Assert.assertThat; -import static org.junit.matchers.JUnitMatchers.hasItem; +import static org.hamcrest.CoreMatchers.hasItem; @NodeEntity class Program { @@ -64,7 +64,7 @@ public class DeleteEventTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } @Bean diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/SaveEventTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/SaveEventTests.java index 9c75348d6..ad87d09c4 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/SaveEventTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/lifecycle/SaveEventTests.java @@ -22,7 +22,7 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; @@ -178,7 +178,7 @@ public class SaveEventTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } @Bean diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/mapping/Neo4jPersistentTestBase.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/mapping/Neo4jPersistentTestBase.java index 1f25e6568..f2fc61365 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/mapping/Neo4jPersistentTestBase.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/mapping/Neo4jPersistentTestBase.java @@ -19,7 +19,7 @@ import org.junit.After; import org.junit.Before; import org.neo4j.graphdb.*; import org.neo4j.helpers.collection.IteratorUtil; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.core.convert.ConversionService; import org.springframework.data.convert.DefaultTypeMapper; import org.springframework.data.convert.TypeMapper; @@ -104,7 +104,7 @@ public class Neo4jPersistentTestBase { private Infrastructure createInfrastructure(Neo4jMappingContext mappingContext) throws Exception { MappingInfrastructureFactoryBean factoryBean = new MappingInfrastructureFactoryBean(); - final GraphDatabaseService gdb = new ImpermanentGraphDatabase(); + final GraphDatabaseService gdb = new TestGraphDatabaseFactory().newImpermanentDatabase(); factoryBean.setGraphDatabaseService(gdb); final DelegatingGraphDatabase graphDatabase = new DelegatingGraphDatabase(gdb); factoryBean.setGraphDatabase(graphDatabase); diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/DerivedFinderTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/DerivedFinderTests.java index e7630a672..ecb7e8178 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/DerivedFinderTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/DerivedFinderTests.java @@ -21,7 +21,7 @@ import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Transaction; import org.neo4j.helpers.collection.IteratorUtil; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -173,7 +173,7 @@ public class DerivedFinderTests { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/NoIndexDerivedFinderTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/NoIndexDerivedFinderTests.java index 1f687ee63..7805b2d47 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/NoIndexDerivedFinderTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/NoIndexDerivedFinderTests.java @@ -20,11 +20,13 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.cypher.javacompat.ExecutionEngine; import org.neo4j.cypher.javacompat.ExecutionResult; +import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.index.Index; import org.neo4j.helpers.collection.IteratorUtil; import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -79,7 +81,7 @@ public class NoIndexDerivedFinderTests { @Test public void testWithSeparateTransactions() throws Exception { - final ImpermanentGraphDatabase gdb = new ImpermanentGraphDatabase(); + final GraphDatabaseService gdb = new TestGraphDatabaseFactory().newImpermanentDatabase(); final Thread t = new Thread() { @Override public void run() { diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByArrayOfSimpleTypeTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByArrayOfSimpleTypeTests.java index afbe0b96b..2dc4eb01b 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByArrayOfSimpleTypeTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByArrayOfSimpleTypeTests.java @@ -20,7 +20,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Transaction; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -116,7 +116,7 @@ public class InParameterisedByArrayOfSimpleTypeTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByDateTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByDateTests.java index 9f3adb2a6..1245da5bf 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByDateTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByDateTests.java @@ -20,7 +20,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Transaction; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -86,7 +86,7 @@ public class InParameterisedByDateTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByEnumTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByEnumTests.java index 48bdac87a..a803626b6 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByEnumTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedByEnumTests.java @@ -20,7 +20,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Transaction; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -87,7 +87,7 @@ public class InParameterisedByEnumTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedBySimpleTypeTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedBySimpleTypeTests.java index 81ca1696c..714cf9eff 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedBySimpleTypeTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/InParameterisedBySimpleTypeTests.java @@ -20,7 +20,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Transaction; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -108,7 +108,7 @@ public class InParameterisedBySimpleTypeTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/ParameterisedInTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/ParameterisedInTests.java index b509fff61..1b1c55609 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/ParameterisedInTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/repository/query/cypher/ParameterisedInTests.java @@ -20,7 +20,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Transaction; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -72,7 +72,7 @@ public class ParameterisedInTests { static class TestConfig extends Neo4jConfiguration { @Bean GraphDatabaseService graphDatabaseService() { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/support/DelegatingGraphDatabaseTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/support/DelegatingGraphDatabaseTests.java index 23f1991c1..57603052d 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/support/DelegatingGraphDatabaseTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/support/DelegatingGraphDatabaseTests.java @@ -18,11 +18,11 @@ package org.springframework.data.neo4j.support; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.Transaction; -import org.neo4j.helpers.collection.MapUtil; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import static org.junit.Assert.assertEquals; import static org.neo4j.helpers.collection.MapUtil.map; @@ -34,11 +34,11 @@ import static org.neo4j.helpers.collection.MapUtil.map; public class DelegatingGraphDatabaseTests { private DelegatingGraphDatabase graphDatabase; - private ImpermanentGraphDatabase gdb; + private GraphDatabaseService gdb; @Before public void setUp() throws Exception { - gdb = new ImpermanentGraphDatabase(); + gdb = new TestGraphDatabaseFactory().newImpermanentDatabase(); graphDatabase = new DelegatingGraphDatabase(gdb); } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/template/Neo4jTemplateApiTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/template/Neo4jTemplateApiTests.java index dad365391..b76621404 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/template/Neo4jTemplateApiTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/template/Neo4jTemplateApiTests.java @@ -26,7 +26,7 @@ import org.neo4j.graphdb.index.Index; import org.neo4j.graphdb.traversal.TraversalDescription; import org.neo4j.kernel.Traversal; import org.neo4j.kernel.impl.transaction.SpringTransactionManager; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.dao.DataAccessException; import org.springframework.data.neo4j.conversion.ResultConverter; import org.springframework.data.neo4j.core.GraphDatabase; @@ -74,7 +74,7 @@ public class Neo4jTemplateApiTests { } protected GraphDatabaseService createGraphDatabaseService() throws IOException { - return new ImpermanentGraphDatabase(); + return new TestGraphDatabaseFactory().newImpermanentDatabase(); } protected GraphDatabase createGraphDatabase() throws Exception { diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/template/NeoApiTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/template/NeoApiTests.java index 47e3c5939..e76767c6f 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/template/NeoApiTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/template/NeoApiTests.java @@ -21,7 +21,7 @@ import org.junit.Before; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.kernel.GraphDatabaseAPI; import org.neo4j.kernel.impl.transaction.SpringTransactionManager; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.core.convert.ConversionService; import org.springframework.data.neo4j.core.GraphDatabase; import org.springframework.data.neo4j.fieldaccess.Neo4jConversionServiceFactoryBean; @@ -58,7 +58,7 @@ public abstract class NeoApiTests { protected GraphDatabase createGraphDatabase() throws Exception { - graphDatabaseService = new ImpermanentGraphDatabase( ); + graphDatabaseService = new TestGraphDatabaseFactory().newImpermanentDatabase(); return new DelegatingGraphDatabase(graphDatabaseService); } diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/typerepresentation/TypeRepresentationTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/typerepresentation/TypeRepresentationTests.java index 00e039dcc..7c47c34fe 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/typerepresentation/TypeRepresentationTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/typerepresentation/TypeRepresentationTests.java @@ -16,19 +16,18 @@ package org.springframework.data.neo4j.typerepresentation; import org.junit.Test; +import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Transaction; -import org.neo4j.test.ImpermanentGraphDatabase; +import org.neo4j.test.TestGraphDatabaseFactory; import org.springframework.data.neo4j.model.Person; -import org.springframework.data.neo4j.support.MappingInfrastructure; import org.springframework.data.neo4j.support.MappingInfrastructureFactoryBean; import org.springframework.data.neo4j.support.Neo4jTemplate; -import org.springframework.data.neo4j.support.typerepresentation.SubReferenceNodeTypeRepresentationStrategy; import org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory; public class TypeRepresentationTests { @Test public void testSavingTwiceResultsOnlyInOneTRSCall() throws Exception { - ImpermanentGraphDatabase db = new ImpermanentGraphDatabase(); + GraphDatabaseService db = new TestGraphDatabaseFactory().newImpermanentDatabase(); MappingInfrastructureFactoryBean factoryBean = new MappingInfrastructureFactoryBean(db, null); factoryBean.setTypeRepresentationStrategy(TypeRepresentationStrategyFactory.Strategy.SubRef); factoryBean.afterPropertiesSet(); diff --git a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/unique/UniqueEntityTests.java b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/unique/UniqueEntityTests.java index 3524d0dd1..129ad6cf0 100644 --- a/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/unique/UniqueEntityTests.java +++ b/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/unique/UniqueEntityTests.java @@ -30,12 +30,11 @@ import org.springframework.data.neo4j.unique.repository.ClubRepository; import org.springframework.data.neo4j.unique.repository.InvalidClubRepository; import org.springframework.data.neo4j.unique.repository.UniqueClubRepository; import org.springframework.data.neo4j.unique.repository.UniqueNumericIdClubRepository; -import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static junit.framework.Assert.assertEquals; +import static org.junit.Assert.assertEquals; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath:unique-test-context.xml"})