{"id":10082,"date":"2013-03-30T15:00:36","date_gmt":"2013-03-30T13:00:36","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=10082"},"modified":"2013-03-29T06:28:44","modified_gmt":"2013-03-29T04:28:44","slug":"testing-spring-data-neo4j-applications-with-nosqlunit","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html","title":{"rendered":"Testing Spring Data Neo4j Applications with NoSQLUnit"},"content":{"rendered":"<p><b>Spring Data Neo4j<\/b> is the project within <em>Spring Data<\/em> project which provides an extension to the <em>Spring<\/em> programming model for writing applications that uses <em>Neo4j<\/em> as graph database. To write tests using <b>NoSQLUnit<\/b> for <b>Spring Data Neo4j<\/b> applications, you do need nothing special apart from considering that <b>Spring Data Neo4j<\/b> uses a special property called <code><em>type<\/em><\/code> in graph nodes and relationships which stores the fully qualified classname of that entity.<\/p>\n<p>Apart from <code><em>type<\/em><\/code> property at node\/relationship level, we also need to create one index for nodes and one index for relationships. In case of nodes, <code><em>types<\/em><\/code> index name is required, meanwhile <code><em>rel_types<\/em><\/code> is required for relationships. In both cases we must set key value to <code><em>className<\/em><\/code> and value to full qualified classname.<\/p>\n<h4>Type mapping<\/h4>\n<p><code>IndexingNodeTypeRepresentationStrategy<\/code> and <code>IndexingRelationshipTypeRepresentationStrategy<\/code> are used as default type mapping implementation, but you can also use <code>SubReferenceNodeTypeRepresentationStrategy<\/code> which stores entity types in a tree in the graph representing the type and interface hierarchy, or you can customize even more by implementing <code>NodeTypeRepresentationStrategy<\/code> interface.<\/p>\n<h2> Hands on Work<\/h2>\n<h3> <a href=\"http:\/\/www.blogger.com\/blogger.g?blogID=19517292\" name=\"_application\"><\/a>Application<\/h3>\n<p><em>Starfleet<\/em> has asked us to develop an application for storing all starfleet members, with their relationship with other starfleet members, and the ship where they serve. The best way to implement this requirement is using <b>Neo4j<\/b> database as backend system. Moreover <b>Spring Data Neo4j<\/b> is used at persistence layer. This application is modelized into two <em>Java<\/em> classes, one for members and another one for starships. Note that for this example there are no properties in relationships, so only nodes are modelized.<\/p>\n<h4>Member class<\/h4>\n<pre class=\" brush:java\">@NodeEntity\r\npublic class Member {\r\n\r\n        private static final String COMMANDS = \"COMMANDS\";\r\n\r\n        @GraphId Long nodeId;\r\n\r\n        private String name;\r\n\r\n        private Starship assignedStarship;\r\n\r\n        public Member() {\r\n                super();\r\n        }\r\n\r\n        public Member(String name) {\r\n                this.name = name;\r\n        }\r\n\r\n        @Fetch @RelatedTo(type=COMMANDS, direction=Direction.OUTGOING)\r\n        private Set&lt;Member&gt; commands;\r\n\r\n        public void command(Member member) {\r\n                this.commands.add(member);\r\n        }\r\n\r\n        public Set&lt;Member&gt; commands() {\r\n                return this.commands;\r\n        }\r\n\r\n        public Starship getAssignedStarship() {\r\n                return assignedStarship;\r\n        }\r\n\r\n        public String getName() {\r\n                return name;\r\n        }\r\n\r\n        public void assignedIn(Starship starship) {\r\n                this.assignedStarship = starship;\r\n        }\r\n\r\n        \/\/Equals and Hash methods\r\n}<\/pre>\n<h4>Starship class<\/h4>\n<pre class=\" brush:java\">@NodeEntity\r\npublic class Starship {\r\n\r\n        private static final String ASSIGNED = \"assignedStarship\";\r\n\r\n        @GraphId Long nodeId;\r\n\r\n        private String starship;\r\n\r\n        public Starship() {\r\n                super();\r\n        }\r\n\r\n        public Starship(String starship) {\r\n                this.starship = starship;\r\n        }\r\n\r\n        @RelatedTo(type = ASSIGNED, direction=Direction.INCOMING)\r\n        private Set&lt;Member&gt; crew;\r\n\r\n        public String getStarship() {\r\n                return starship;\r\n        }\r\n\r\n        public void setStarship(String starship) {\r\n                this.starship = starship;\r\n        }\r\n\r\n        \/\/Equals and Hash methods\r\n}<\/pre>\n<p>Apart from model classes, we also need two repositories for implementing CRUD operations, and <em>spring context<\/em> <code>xml<\/code> file. <b>Spring Data Neo4j<\/b> uses <em>Spring Data Commons<\/em> infrastructure allowing us to create interface based compositions of repositories, providing default implementations for certain operations.<\/p>\n<h4>MemberRepository class<\/h4>\n<pre class=\" brush:java\">public interface MemberRepository extends GraphRepository&lt;Member&gt;,\r\n                RelationshipOperationsRepository&lt;Member&gt; {\r\n\r\n        Member findByName(String name);\r\n\r\n}<\/pre>\n<p>See that apart from operations provided by <code>GrapRepository<\/code> interface like <code>save<\/code>, <code>findAll<\/code>, <code>findById<\/code>, \u2026 we are defining one query method too called <code>findByName<\/code>. <em>Spring Data Neo4j<\/em> repositories (and most of <em>Spring Data<\/em> projects) provide a mechanism to define queries using the known <em>Ruby on Rails<\/em> approach for defining finder queries.<\/p>\n<h4>StarshipRepository class<\/h4>\n<pre class=\" brush:java\">public interface StarshipRepository extends GraphRepository&lt;Starship&gt;,\r\n                RelationshipOperationsRepository&lt;Starship&gt; {\r\n}<\/pre>\n<h4>application-context file<\/h4>\n<pre class=\" brush:xml\">&lt;beans xmlns=\"http:\/\/www.springframework.org\/schema\/beans\"\r\n       xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n       xmlns:context=\"http:\/\/www.springframework.org\/schema\/context\"\r\n       xmlns:neo4j=\"http:\/\/www.springframework.org\/schema\/data\/neo4j\"\r\n       xsi:schemaLocation=\"http:\/\/www.springframework.org\/schema\/beans\r\n           http:\/\/www.springframework.org\/schema\/beans\/spring-beans-3.1.xsd\r\n           http:\/\/www.springframework.org\/schema\/context\r\n           http:\/\/www.springframework.org\/schema\/context\/spring-context-3.1.xsd\r\n           http:\/\/www.springframework.org\/schema\/data\/neo4j\r\n           http:\/\/www.springframework.org\/schema\/data\/neo4j\/spring-neo4j.xsd\"&gt;\r\n\r\n     &lt;context:component-scan base-package=\"com.lordofthejars.nosqlunit.springdata.neo4j\"\/&gt;\r\n     &lt;context:annotation-config\/&gt;\r\n\r\n     &lt;neo4j:repositories base-package=\"com.lordofthejars.nosqlunit.springdata.repository\"\/&gt;\r\n\r\n&lt;\/beans&gt;<\/pre>\n<h3> <a href=\"http:\/\/www.blogger.com\/blogger.g?blogID=19517292\" name=\"_testing\"><\/a>Testing<\/h3>\n<h4> <a href=\"http:\/\/www.blogger.com\/blogger.g?blogID=19517292\" name=\"_unit_testing\"><\/a>Unit Testing<\/h4>\n<p>As it has been told previously, for writing datasets for <b>Spring Data Neo4j<\/b>, we don\u2019t have to do anything special beyond creating node and relationship properties correctly and defining the required indexes. Let\u2019s see the dataset used to test the <code>findByName<\/code> method by seeding<br \/>\n<em>Neo4j<\/em> database.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h4>star-trek-TNG-dataset.xml file<\/h4>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\" ?&gt;\r\n&lt;graphml xmlns=\"http:\/\/graphml.graphdrawing.org\/xmlns\"\r\n        xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n        xsi:schemaLocation=\"http:\/\/graphml.graphdrawing.org\/xmlns http:\/\/graphml.graphdrawing.org\/xmlns\/1.0\/graphml.xsd\"&gt;\r\n     &lt;key id=\"name\" for=\"node\" attr.name=\"name\" attr.type=\"string\"&gt;&lt;\/key&gt;\r\n     &lt;key id=\"__type__\" for=\"node\" attr.name=\"__type__\" attr.type=\"string\"&gt;&lt;\/key&gt;\r\n     &lt;key id=\"starship\" for=\"node\" attr.name=\"starship\" attr.type=\"string\"&gt;&lt;\/key&gt;\r\n     &lt;graph id=\"G\" edgedefault=\"directed\"&gt;\r\n\r\n       &lt;node id=\"3\"&gt;\r\n        &lt;data key=\"__type__\"&gt;com.lordofthejars.nosqlunit.springdata.neo4j.Member&lt;\/data&gt;\r\n        &lt;data key=\"name\"&gt;Jean-Luc Picard&lt;\/data&gt;\r\n        &lt;index name=\"__types__\" key=\"className\"&gt;com.lordofthejars.nosqlunit.springdata.neo4j.Member&lt;\/index&gt;\r\n      &lt;\/node&gt;\r\n\r\n      &lt;node id=\"1\"&gt;\r\n        &lt;data key=\"__type__\"&gt;com.lordofthejars.nosqlunit.springdata.neo4j.Member&lt;\/data&gt;\r\n        &lt;data key=\"name\"&gt;William Riker&lt;\/data&gt;\r\n        &lt;index name=\"__types__\" key=\"className\"&gt;com.lordofthejars.nosqlunit.springdata.neo4j.Member&lt;\/index&gt;\r\n      &lt;\/node&gt;\r\n\r\n      &lt;node id=\"4\"&gt;\r\n        &lt;data key=\"__type__\"&gt;com.lordofthejars.nosqlunit.springdata.neo4j.Starship&lt;\/data&gt;\r\n        &lt;data key=\"starship\"&gt;NCC-1701-E&lt;\/data&gt;\r\n        &lt;index name=\"__types__\" key=\"className\"&gt;com.lordofthejars.nosqlunit.springdata.neo4j.Starship&lt;\/index&gt;\r\n      &lt;\/node&gt;\r\n\r\n      &lt;edge id=\"11\" source=\"3\" target=\"4\" label=\"assignedStarship\"&gt;&lt;\/edge&gt;\r\n      &lt;edge id=\"12\" source=\"1\" target=\"4\" label=\"assignedStarship\"&gt;&lt;\/edge&gt;\r\n      &lt;edge id=\"13\" source=\"3\" target=\"1\" label=\"COMMANDS\"&gt;&lt;\/edge&gt;\r\n\r\n    &lt;\/graph&gt;\r\n&lt;\/graphml&gt;<\/pre>\n<p>See that each node has at least one <code><em>type<\/em><\/code> property with full qualified classname and an index with name <code><em>types<\/em><\/code>, key <code><em>className<\/em><\/code> and full qualified classname as value. Next step is configuring application context for unit tests. <b>application-context-embedded-neo4j.xml<\/b><\/p>\n<pre class=\" brush:xml\">&lt;beans xmlns=\"http:\/\/www.springframework.org\/schema\/beans\"\r\n       xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n       xmlns:context=\"http:\/\/www.springframework.org\/schema\/context\"\r\n       xmlns:neo4j=\"http:\/\/www.springframework.org\/schema\/data\/neo4j\"\r\n       xsi:schemaLocation=\"http:\/\/www.springframework.org\/schema\/beans\r\n           http:\/\/www.springframework.org\/schema\/beans\/spring-beans-3.1.xsd\r\n           http:\/\/www.springframework.org\/schema\/context\r\n           http:\/\/www.springframework.org\/schema\/context\/spring-context-3.1.xsd\r\n           http:\/\/www.springframework.org\/schema\/data\/neo4j\r\n           http:\/\/www.springframework.org\/schema\/data\/neo4j\/spring-neo4j.xsd\"&gt;\r\n\r\n\r\n        &lt;import resource=\"classpath:com\/lordofthejars\/nosqlunit\/springdata\/neo4j\/application-context.xml\"\/&gt;\r\n        &lt;neo4j:config storeDirectory=\"target\/config-test\"\/&gt;\r\n\r\n&lt;\/beans&gt;<\/pre>\n<p>Notice that we are using <em>Neo4j<\/em> namespace for instantiating an embedded <em>Neo4j<\/em> database. And now we can write the <em>JUnit<\/em> test case: <b>WhenInformationAboutAMemberIsRequired<\/b> <\/p>\n<pre class=\" brush:java\">@RunWith(SpringJUnit4ClassRunner.class)\r\n@ContextConfiguration(\"application-context-embedded-neo4j.xml\")\r\npublic class WhenInformationAboutAMemberIsRequired {\r\n\r\n        @Autowired\r\n        private MemberRepository memberRepository;\r\n        @Autowired\r\n        private StarshipRepository starshipRepository;\r\n\r\n        @Autowired\r\n        private ApplicationContext applicationContext;\r\n\r\n        @Rule\r\n        public Neo4jRule neo4jRule = newNeo4jRule()\r\n                        .defaultSpringGraphDatabaseServiceNeo4j();\r\n\r\n        @Test\r\n        @UsingDataSet(locations = \"star-trek-TNG-dataset.xml\", loadStrategy = LoadStrategyEnum.CLEAN_INSERT)\r\n        public void information_about_starship_where_serves_and_members_under_his_service_should_be_retrieved()  {\r\n\r\n                Member jeanLuc = memberRepository.findByName(\"Jean-Luc Picard\");\r\n\r\n                assertThat(jeanLuc, is(createMember(\"Jean-Luc Picard\")));\r\n                assertThat(jeanLuc.commands(), containsInAnyOrder(createMember(\"William Riker\")));\r\n\r\n\r\n                Starship starship = starshipRepository.findOne(jeanLuc.getAssignedStarship().nodeId);\r\n                assertThat(starship, is(createStarship(\"NCC-1701-E\")));\r\n        }\r\n\r\n        private Object createStarship(String starship) {\r\n                return new Starship(starship);\r\n        }\r\n\r\n        private static Member createMember(String memberName) {\r\n                return new Member(memberName);\r\n        }\r\n}<\/pre>\n<p>There are some important points in the previous class to take under consideration:<\/p>\n<ol>\n<li>Recall that we need to use <em>Spring<\/em> <code>ApplicationContext<\/code> object to retrieve embedded <em>Neo4j<\/em> instance defined into <em>Spring<\/em> application context.<\/li>\n<li>Since lifecycle of database is managed by <em>Spring Data<\/em> container, there is no need to define any <b>NoSQLUnit<\/b> lifecycle manager.<\/li>\n<\/ol>\n<h4> <a href=\"http:\/\/www.blogger.com\/blogger.g?blogID=19517292\" name=\"_integration_test\"><\/a>Integration Test<\/h4>\n<p>Unit tests are usually run against embedded in-memory instances, but in production environment you may require access to external <em>Neo4j<\/em> servers by using <em>Rest<\/em> connection, or in case of <em>Spring Data Neo4j<\/em> instantiating <code>SpringRestGraphDatabase<\/code> class. You need to write tests to validate that your application still works when you integrate your code with a remote server, and this tests are typically known as integration tests. To write integration tests for our application is as easy as defining an application context with <code>SpringRestGraphDatabase<\/code> and allow <b>NoSQLUnit<\/b> to control the lifecycle of <em>Neo4j<\/em> database.<\/p>\n<pre class=\" brush:java\">.application-context-managed-neo4j.xml<\/pre>\n<pre class=\" brush:xml\">&lt;beans xmlns=\"http:\/\/www.springframework.org\/schema\/beans\"\r\n       xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n       xmlns:context=\"http:\/\/www.springframework.org\/schema\/context\"\r\n       xmlns:neo4j=\"http:\/\/www.springframework.org\/schema\/data\/neo4j\"\r\n       xsi:schemaLocation=\"http:\/\/www.springframework.org\/schema\/beans\r\n           http:\/\/www.springframework.org\/schema\/beans\/spring-beans-3.1.xsd\r\n           http:\/\/www.springframework.org\/schema\/context\r\n           http:\/\/www.springframework.org\/schema\/context\/spring-context-3.1.xsd\r\n           http:\/\/www.springframework.org\/schema\/data\/neo4j\r\n           http:\/\/www.springframework.org\/schema\/data\/neo4j\/spring-neo4j.xsd\"&gt;\r\n\r\n\r\n        &lt;import resource=\"classpath:com\/lordofthejars\/nosqlunit\/springdata\/neo4j\/application-context.xml\"\/&gt;\r\n\r\n        &lt;bean id=\"graphDatabaseService\" class=\"org.springframework.data.neo4j.rest.SpringRestGraphDatabase\"&gt;\r\n                &lt;constructor-arg index=\"0\" value=\"http:\/\/localhost:7474\/db\/data\"&gt;&lt;\/constructor-arg&gt;\r\n        &lt;\/bean&gt;\r\n        &lt;neo4j:config graphDatabaseService=\"graphDatabaseService\"\/&gt;\r\n\r\n&lt;\/beans&gt;<\/pre>\n<p>Note how instead of registering an embedded instance, we are configuring <code>SpringRestGraphDatabase<\/code> class to connect to localhost server. And let\u2019s implement an integration test which verifies that all starships can be retrieved from <em>Neo4j<\/em> server.<\/p>\n<h4>WhenInformationAboutAMemberIsRequired<\/h4>\n<pre class=\" brush:java\">@RunWith(SpringJUnit4ClassRunner.class)\r\n@ContextConfiguration(\"application-context-managed-neo4j.xml\")\r\npublic class WhenInformationAboutStarshipsAreRequired {\r\n\r\n        @ClassRule\r\n        public static ManagedNeoServer managedNeoServer = newManagedNeo4jServerRule()\r\n                        .neo4jPath(\r\n                                        \"\/Users\/alexsotobueno\/Applications\/neo4j-community-1.7.2\")\r\n                        .build();\r\n\r\n        @Autowired\r\n        private StarshipRepository starshipRepository;\r\n\r\n        @Autowired\r\n        private ApplicationContext applicationContext;\r\n\r\n        @Rule\r\n        public Neo4jRule neo4jRule = newNeo4jRule()\r\n                        .defaultSpringGraphDatabaseServiceNeo4j();\r\n\r\n        @Test\r\n        @UsingDataSet(locations = \"star-trek-TNG-dataset.xml\", loadStrategy = LoadStrategyEnum.CLEAN_INSERT)\r\n        public void information_about_starship_where_serves_and_members_under_his_service_should_be_retrieved() {\r\n\r\n                EndResult&lt;Starship&gt; allStarship = starshipRepository.findAll();\r\n\r\n                assertThat(allStarship, containsInAnyOrder(createStarship(\"NCC-1701-E\")));\r\n\r\n        }\r\n\r\n        private Object createStarship(String starship) {\r\n                return new Starship(starship);\r\n        }\r\n\r\n}<\/pre>\n<p>Because <code>defaultSpringGraphDatabaseServiceNeo4j<\/code> method returns a <code>GraphDatabaseService<\/code> instance defined into <em>application context<\/em>, in our case it will return the defined <code>SpringRestGraphDatabase<\/code> instance.<\/p>\n<h2> <a href=\"http:\/\/www.blogger.com\/blogger.g?blogID=19517292\" name=\"_conclusions\"><\/a>Conclusions<\/h2>\n<p>There is not much difference between writing tests for none <b>Spring Data Neo4j<\/b> applications than the ones they use it. Only keep in mind to define correctly the <code><em>type<\/em><\/code> property and create required indexes. Also see that from the point of view of <b>NoSQLUnit<\/b> there is no difference between writing unit or integration tests, apart of lifecycle management of the database engine. <a href=\"http:\/\/dl.dropbox.com\/u\/153958901\/spring-data-neo4j.zip\">Download Code<\/a><br \/>\n&nbsp;<\/p>\n<p><b><i>Reference: <\/i><\/b><a href=\"http:\/\/www.lordofthejars.com\/2013\/03\/testing-spring-data-neo4j-applications.html\">Testing Spring Data Neo4j Applications with NoSQLUnit<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Alex Soto at the <a href=\"http:\/\/www.lordofthejars.com\/\">One Jar To Rule Them All<\/a> blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Data Neo4j is the project within Spring Data project which provides an extension to the Spring programming model for writing applications that uses Neo4j as graph database. To write tests using NoSQLUnit for Spring Data Neo4j applications, you do need nothing special apart from considering that Spring Data Neo4j uses a special property called &hellip;<\/p>\n","protected":false},"author":119,"featured_media":191,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[349,528,30,321,273],"class_list":["post-10082","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-neo4j","tag-nosqlunit","tag-spring","tag-spring-data","tag-testing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Testing Spring Data Neo4j Applications with NoSQLUnit<\/title>\n<meta name=\"description\" content=\"Spring Data Neo4j is the project within Spring Data project which provides an extension to the Spring programming model for writing applications that uses\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Testing Spring Data Neo4j Applications with NoSQLUnit\" \/>\n<meta property=\"og:description\" content=\"Spring Data Neo4j is the project within Spring Data project which provides an extension to the Spring programming model for writing applications that uses\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-03-30T13:00:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/neo4j-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alex Soto\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/alexsotob\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alex Soto\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html\"},\"author\":{\"name\":\"Alex Soto\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/6566a1238c71f5d85ba5b5df5d2eac59\"},\"headline\":\"Testing Spring Data Neo4j Applications with NoSQLUnit\",\"datePublished\":\"2013-03-30T13:00:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html\"},\"wordCount\":762,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/neo4j-logo.jpg\",\"keywords\":[\"Neo4j\",\"NoSQLUnit\",\"Spring\",\"Spring Data\",\"Testing\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html\",\"name\":\"Testing Spring Data Neo4j Applications with NoSQLUnit\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/neo4j-logo.jpg\",\"datePublished\":\"2013-03-30T13:00:36+00:00\",\"description\":\"Spring Data Neo4j is the project within Spring Data project which provides an extension to the Spring programming model for writing applications that uses\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/neo4j-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/neo4j-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/03\\\/testing-spring-data-neo4j-applications-with-nosqlunit.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Testing Spring Data Neo4j Applications with NoSQLUnit\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/6566a1238c71f5d85ba5b5df5d2eac59\",\"name\":\"Alex Soto\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g\",\"caption\":\"Alex Soto\"},\"sameAs\":[\"http:\\\/\\\/www.lordofthejars.com\\\/\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/alexsotob\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Alex-Soto\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Testing Spring Data Neo4j Applications with NoSQLUnit","description":"Spring Data Neo4j is the project within Spring Data project which provides an extension to the Spring programming model for writing applications that uses","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html","og_locale":"en_US","og_type":"article","og_title":"Testing Spring Data Neo4j Applications with NoSQLUnit","og_description":"Spring Data Neo4j is the project within Spring Data project which provides an extension to the Spring programming model for writing applications that uses","og_url":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-03-30T13:00:36+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/neo4j-logo.jpg","type":"image\/jpeg"}],"author":"Alex Soto","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/alexsotob","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Alex Soto","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html"},"author":{"name":"Alex Soto","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/6566a1238c71f5d85ba5b5df5d2eac59"},"headline":"Testing Spring Data Neo4j Applications with NoSQLUnit","datePublished":"2013-03-30T13:00:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html"},"wordCount":762,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/neo4j-logo.jpg","keywords":["Neo4j","NoSQLUnit","Spring","Spring Data","Testing"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html","url":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html","name":"Testing Spring Data Neo4j Applications with NoSQLUnit","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/neo4j-logo.jpg","datePublished":"2013-03-30T13:00:36+00:00","description":"Spring Data Neo4j is the project within Spring Data project which provides an extension to the Spring programming model for writing applications that uses","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/neo4j-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/neo4j-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/03\/testing-spring-data-neo4j-applications-with-nosqlunit.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Testing Spring Data Neo4j Applications with NoSQLUnit"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/6566a1238c71f5d85ba5b5df5d2eac59","name":"Alex Soto","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cc3a211b790033d32fee33bb321b7bb6e2d381dab14531d3f2e8df9885bca7f9?s=96&d=mm&r=g","caption":"Alex Soto"},"sameAs":["http:\/\/www.lordofthejars.com\/","https:\/\/x.com\/http:\/\/twitter.com\/alexsotob"],"url":"https:\/\/www.javacodegeeks.com\/author\/Alex-Soto"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/10082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=10082"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/10082\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/191"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=10082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=10082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=10082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}