Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira
Created July 30, 2020 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliasnogueira/12102fec76c11c3b0c64932dfe84b3e4 to your computer and use it in GitHub Desktop.
Save eliasnogueira/12102fec76c11c3b0c64932dfe84b3e4 to your computer and use it in GitHub Desktop.
Blog post about Data Management - PersonFactory code snippet
public class PersonFactory {
private final Faker faker;
public PersonFactory() {
faker = new Faker();
}
public Person personAbleToGetDriverLicense() {
return new PersonBuilder().
setName(faker.name().fullName()).
setAge(faker.number().numberBetween(16, 65)).
build();
}
public Person personNotAbleToGetDriverLicense() {
return new PersonBuilder().
setName(faker.name().fullName()).
setAge(faker.number().numberBetween(0, 16)).
build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment