Skip to content

Instantly share code, notes, and snippets.

@ParasoftExamples
Created September 7, 2018 21:04
Show Gist options
  • Save ParasoftExamples/7d3ef919eb158feb2ff1b54f3bc1d3b4 to your computer and use it in GitHub Desktop.
Save ParasoftExamples/7d3ef919eb158feb2ff1b54f3bc1d3b4 to your computer and use it in GitHub Desktop.
Junit Parameterized Tests Example 5
@Parameters(name = "Run {index}: loanAmount={0}, downPayment={1}, availableFunds={2}, expectApproved={3}, expectedMessage={4}")
public static Iterable<Object[]> data() throws Throwable
{
return Arrays.asList(new Object[][] {
{ 1000.0f, 200.0f, 250.0f, true, null },
{ 1000.0f, 50.0f, 250.0f, false, "error.insufficient.down.payment" },
{ 1000.0f, 200.0f, 150.0f, false, "error.insufficient.funds.for.down.payment" }
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment