I updated from Cucumber-JVM 2.4.0 to 3.0.2 in my pom.xml and DataTables started throwing this exception:
io.cucumber.datatable.UndefinedD
Use DataTableType annotation
@DataTableType
public Income incomeEntry(Map entry) {
return new Income(entry.get("name"), entry.get("amount"), entry.get("frequency"));
}
Then you can directly use the list of the custom class in step definition
@When("^I Enter My Regular Income Sources$")
public void I_Enter_My_Regular_Income_Sources(List incomes) throws Throwable {
// More code
}