Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JavaFaker example for the CustomerData data generation
class BasicExampleTest {
@Test
@DisplayName("Data validations using faker library")
void faker() {
Faker faker = new Faker();
CustomerData customerData = CustomerData.builder().
id((int) faker.number().randomNumber()).
name(faker.name().name()).
profession(faker.company().profession()).
accountNumber(faker.finance().iban("NL")).
address(faker.address().streetAddress()).
phoneNumber(faker.phoneNumber().cellPhone()).
birthday(faker.date().birthday(18, 90)).
build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment