Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira
Last active September 26, 2021 20:01
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/30d2a794e836b6abab45c00248a34df5 to your computer and use it in GitHub Desktop.
Save eliasnogueira/30d2a794e836b6abab45c00248a34df5 to your computer and use it in GitHub Desktop.
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