Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira
Created July 30, 2020 11:55
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/ebdec1fcb2d52403fd9647ca947225d9 to your computer and use it in GitHub Desktop.
Save eliasnogueira/ebdec1fcb2d52403fd9647ca947225d9 to your computer and use it in GitHub Desktop.
Blog post about Data Management - JUnitCSVSourceTest code snippet
class JUnitCSVSourceTest {
private static final String MAXIMUM_PRICE = "30.0";
@CsvFileSource(resources = "/products.csv", numLinesToSkip = 1)
void productsLassThan(String product, BigDecimal amount) {
assertThat(product).isNotEmpty();
assertThat(amount).isLessThanOrEqualTo(new BigDecimal(MAXIMUM_PRICE));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment