Пример #1
0
  public TestPerson(String firstName, String lastName, String email) {

    PropertyMap pm = super.getPropertyMap();
    pm.put("firstName", firstName);
    pm.put("lastName", lastName);
    pm.put("email", email);
  }
Пример #2
0
  public static TestPerson randomPerson() {
    Random random = new Random();

    TestPerson randomPerson = new TestPerson();

    PropertyMap pm = randomPerson.getPropertyMap();

    Name fakeName = faker.name();

    pm.put("firstName", fakeName.firstName());
    pm.put("lastName", fakeName.lastName());
    pm.put("email", faker.internet().emailAddress());

    if (random.nextBoolean()) {
      Business bInfo = faker.business();
      pm.put("creditCard.Type", bInfo.creditCardType());
      pm.put("creditCard.Number", bInfo.creditCardNumber());
      pm.put("creditCard.Expiry", bInfo.creditCardExpiry());
    }

    return randomPerson;
  }