Allow mapping of ExamplesTable rows to annotated custom types

Description

The idea is to map the ExamplesTable rows to match a business object.

So, instead of having a method like this:

@Given("some $table")
public void givenAnExamplesTable(ExamplesTable table){ ... }

We'd have something like this:

@Given("some $table")
public void givenACustomBusinessObject(MyCustomObject myObject){ ... }

Or a List of business objects:
@Given("some $table")
public void givenACustomBusinessObject(List<MyCustomObject> myObjectList){ ... }

This can be done in two ways:

  • Annotation-based mapping:

@AsParameters
public class MyCustomObject{
@Parameter(name="column1")
private String col1;

@Parameter(name="column2")
private Boolean col2;
}

  • Named-based mapping, using the name of the field as the parameter name.

Activity

Show:
Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Priority

Created June 5, 2013 at 1:55 AM
Updated June 23, 2013 at 5:00 PM
Resolved June 23, 2013 at 5:00 PM