updating test cases
This commit is contained in:
parent
548365130a
commit
31b3e0fa16
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue