Let's say there is a step in Cucumber scenario step which uses data table:
And I add a new user
| firstName | lastName | workEmail | workPhone | userName | assignedRoles | assignedAdvisorCodes |
| Steven | Gerrard | steeveg@test.com | 12312312346345 | steeveg | Advisor,Compliance | 1107,1108 |
then step definition will look like
@And("^I add a new user$")
public void i_add_a_new_user(List<User> users) {
The gist is that 'User' POJO contains fields of type Collection:
public class User {
private Set<String> assignedRoles;
private Set<String> assignedAdvisorCodes;
and I expected these fields to be populated with what I've specified in cucumber data table delimited with comma.
=================
So, my issue is that 'user' object in List will got assigned all fields from data table except for assignedRoles and assignedAdvisorCodes since both of them are of type Set (actually it does not matter, it could have been anything of Collection type).
please suggest how to overcome this. I use cucumber 2.4.0 but have not found any solution even for version 3+. It's clear how to deal with object having fields if primitive or class data types but NOT with fields of type Collection.