Пример #1
0
 protected Object createPerson2() throws Exception {
   Person person = new Person();
   person.setId(2);
   person.setName("Cat");
   person.setSurname("Woman");
   person.setAge(27);
   person.setGender(Person.Gender.FEMALE);
   return person;
 }
Пример #2
0
  protected Object createPerson1() throws Exception {
    Person person = new Person();
    person.setId(1);
    person.setName("John");
    person.setSurname("Batman");
    person.setAge(40);
    person.setGender(Person.Gender.MALE);

    Address address = new Address();
    address.setStreet("Old Street");
    address.setPostCode("SW12345");
    person.setAddress(address);

    PhoneNumber phoneNumber1 = new PhoneNumber();
    phoneNumber1.setNumber("0040888888");
    PhoneNumber phoneNumber2 = new PhoneNumber();
    phoneNumber2.setNumber("004012345");
    person.setPhoneNumbers(Arrays.asList(phoneNumber1, phoneNumber2));
    return person;
  }