Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.