Created
July 30, 2020 11:51
-
-
Save eliasnogueira/12102fec76c11c3b0c64932dfe84b3e4 to your computer and use it in GitHub Desktop.
Blog post about Data Management - PersonFactory code snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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