updating test cases

This commit is contained in:
Sameera 2016-06-28 23:48:45 +05:30
parent 548365130a
commit 31b3e0fa16
2 changed files with 33 additions and 35 deletions

View File

@ -23,8 +23,6 @@ public class Movie {
@Relationship(type="ACTED_IN", direction = Relationship.INCOMING) private List<Role> roles;
// end::movie[]
public Movie() { }
public String getTitle() {

View File

@ -38,25 +38,25 @@ public class MovieRepositoryTest {
@Before
public void initializeDatabase() {
System.out.println("seeding embedded database");
Movie matrix = new Movie();
matrix.setTitle("The Italian Job");
matrix.setReleased(1999);
instance.save(matrix);
Movie italianJob = new Movie();
italianJob.setTitle("The Italian Job");
italianJob.setReleased(1999);
instance.save(italianJob);
Person mark = new Person();
mark.setName("Mark Wahlberg");
personRepository.save(mark);
Role neo = new Role();
neo.setMovie(matrix);
neo.setPerson(mark);
Role charlie = new Role();
charlie.setMovie(italianJob);
charlie.setPerson(mark);
Collection<String> roleNames = new HashSet();
roleNames.add("Charlie Croker");
neo.setRoles(roleNames);
charlie.setRoles(roleNames);
List<Role> roles = new ArrayList();
roles.add(neo);
matrix.setRoles(roles);
instance.save(matrix);
roles.add(charlie);
italianJob.setRoles(roles);
instance.save(italianJob);
}
@Test