Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira
Created July 30, 2020 11:56
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/aedc3028cc6f6310d6b164387f15c23e to your computer and use it in GitHub Desktop.
Save eliasnogueira/aedc3028cc6f6310d6b164387f15c23e to your computer and use it in GitHub Desktop.
Blog post about Data Management - MyTestWithDynamicData code snippet
public class MyTestWithDynamicData {
@Test
void cannotPayWithExpiredCreditCard() {
DynamicData dynamicData = new DynamicData();
CreditCard creditCard = dynamicData.creditCard().withRestriction(Restriction.EXPIRED);
// extraction the credit card information to use in the test
String holderName = creditCard.getHolderName();
String creditCardNumber = creditCard.getNumber();
String expirationDate = creditCard.getExpirationDate();
String cvv = creditCard.getCvv();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment