Skip to content

Commit 1a3e005

Browse files
committed
updating test cases
1 parent 718c04c commit 1a3e005

4 files changed

Lines changed: 7 additions & 51 deletions

File tree

‎spring-data-neo4j/pom.xml‎

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,22 @@
1313
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1414
<neo4j.version>3.0.1</neo4j.version>
1515
<spring-data-neo4j.version>4.1.1.RELEASE</spring-data-neo4j.version>
16-
<spring-data-releasetrain.version>Hopper-SR1</spring-data-releasetrain.version>
1716
</properties>
1817

19-
<parent>
20-
<groupId>org.springframework.boot</groupId>
21-
<artifactId>spring-boot-starter-parent</artifactId>
22-
<version>1.3.0.RELEASE</version>
23-
</parent>
24-
2518
<dependencies>
2619
<dependency>
2720
<groupId>org.springframework.data</groupId>
2821
<artifactId>spring-data-neo4j</artifactId>
2922
<version>${spring-data-neo4j.version}</version>
3023
</dependency>
3124

32-
<dependency>
33-
<groupId>org.springframework.boot</groupId>
34-
<artifactId>spring-boot-starter-data-rest</artifactId>
35-
</dependency>
36-
3725
<dependency>
3826
<groupId>com.voodoodyne.jackson.jsog</groupId>
3927
<artifactId>jackson-jsog</artifactId>
4028
<version>1.1</version>
4129
<scope>compile</scope>
4230
</dependency>
4331

44-
<!-- end::dependencies[] -->
45-
46-
<!-- Test Dependencies -->
4732
<dependency>
4833
<groupId>org.springframework.boot</groupId>
4934
<artifactId>spring-boot-starter-test</artifactId>
@@ -89,11 +74,6 @@
8974
<artifactId>junit</artifactId>
9075
<version>4.12</version>
9176
</dependency>
92-
<dependency>
93-
<groupId>junit</groupId>
94-
<artifactId>junit</artifactId>
95-
<version>4.12</version>
96-
</dependency>
9777
<dependency>
9878
<groupId>org.springframework</groupId>
9979
<artifactId>spring-test</artifactId>
@@ -107,29 +87,7 @@
10787
<plugin>
10888
<artifactId>maven-compiler-plugin</artifactId>
10989
</plugin>
110-
<plugin>
111-
<groupId>org.springframework.boot</groupId>
112-
<artifactId>spring-boot-maven-plugin</artifactId>
113-
</plugin>
11490
</plugins>
11591
</build>
11692

117-
<repositories>
118-
<repository>
119-
<id>spring-milestones</id>
120-
<url>http://repo.spring.io/libs-snapshot</url>
121-
<snapshots>
122-
<enabled>true</enabled>
123-
</snapshots>
124-
</repository>
125-
</repositories>
126-
<pluginRepositories>
127-
<pluginRepository>
128-
<id>spring-milestones</id>
129-
<url>http://repo.spring.io/libs-snapshot</url>
130-
<snapshots>
131-
<enabled>true</enabled>
132-
</snapshots>
133-
</pluginRepository>
134-
</pluginRepositories>
13593
</project>

‎spring-data-neo4j/src/main/java/com/baeldung/spring/data/neo4j/config/MovieDatabaseNeo4jConfiguration.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.baeldung.spring.data.neo4j.config;
22

33
import org.neo4j.ogm.session.SessionFactory;
4-
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
54
import org.springframework.context.annotation.Bean;
65
import org.springframework.context.annotation.ComponentScan;
76
import org.springframework.context.annotation.Configuration;
@@ -13,7 +12,6 @@
1312

1413
@EnableTransactionManagement
1514
@EnableScheduling
16-
@EnableAutoConfiguration
1715
@ComponentScan(basePackages = {"com.baeldung.spring.data.neo4j.services"})
1816
@Configuration
1917
@EnableNeo4jRepositories(basePackages = "com.baeldung.spring.data.neo4j.repostory")

‎spring-data-neo4j/src/main/java/com/baeldung/spring/data/neo4j/repostory/MovieRepository.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
import org.springframework.data.neo4j.annotation.Query;
55
import org.springframework.data.neo4j.repository.GraphRepository;
66
import org.springframework.data.repository.query.Param;
7-
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
87

98
import java.util.Collection;
109
import java.util.List;
1110
import java.util.Map;
1211

1312

14-
@RepositoryRestResource(collectionResourceRel = "movies", path = "movies")
1513
public interface MovieRepository extends GraphRepository<Movie> {
1614
Movie findByTitle(@Param("title") String title);
1715

‎spring-data-neo4j/src/test/java/com/baeldung/spring/data/neo4j/MovieRepositoryTest.java‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public void testCount() {
8282
@DirtiesContext
8383
public void testFindAll() {
8484
System.out.println("findAll");
85-
Collection<Movie> result = (Collection<Movie>) instance.findAll();
85+
Collection<Movie> result =
86+
(Collection<Movie>) instance.findAll();
8687
assertNotNull(result);
8788
assertEquals(1, result.size());
8889
}
@@ -92,7 +93,8 @@ public void testFindAll() {
9293
public void testFindByTitleContaining() {
9394
System.out.println("findByTitleContaining");
9495
String title = "Italian";
95-
Collection<Movie> result = instance.findByTitleContaining(title);
96+
Collection<Movie> result =
97+
instance.findByTitleContaining(title);
9698
assertNotNull(result);
9799
assertEquals(1,result.size());
98100
}
@@ -115,8 +117,7 @@ public void testGraph() {
115117
@DirtiesContext
116118
public void testDeleteMovie() {
117119
System.out.println("deleteMovie");
118-
instance.delete(
119-
instance.findByTitle("The Italian Job"));
120+
instance.delete(instance.findByTitle("The Italian Job"));
120121
assertNull(instance.findByTitle("The Italian Job"));
121122
}
122123

@@ -125,7 +126,8 @@ public void testDeleteMovie() {
125126
public void testDeleteAll() {
126127
System.out.println("deleteAll");
127128
instance.deleteAll();
128-
Collection<Movie> result = (Collection<Movie>) instance.findAll();
129+
Collection<Movie> result =
130+
(Collection<Movie>) instance.findAll();
129131
assertEquals(0,result.size());
130132
}
131133
}

0 commit comments

Comments
 (0)