Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Basic data generation for an object using RandomStringUtils
class BasicExampleTest {
@Test
@DisplayName("Data validations using RandomStringUtils")
void randomStringUtils() {
CustomerData customerData = CustomerData.builder().
id(Integer.valueOf(RandomStringUtils.randomNumeric(10))).
name(RandomStringUtils.randomNumeric(50)).
profession(RandomStringUtils.randomAlphanumeric(30)).
accountNumber(RandomStringUtils.randomAlphanumeric(18)).
address(RandomStringUtils.randomAlphanumeric(50)).
phoneNumber(RandomStringUtils.randomAlphanumeric(14)).
birthday(new Date()).
build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment