@Retention(value=RUNTIME) @Target(value=PARAMETER) public @interface Transpose
This annotation can be specified on step definition method parameters to give Cucumber a hint to transpose a DataTable into an object or list of objects. For example, if you have the following Gherkin step with a table
Given the user is
| firstname | Roberto |
| lastname | Lo Giacco |
| nationality | Italian |
Then the following Java Step Definition would convert that into an User object:
@Given("^the user is$")
public void the_user_is(@Transpose User user) {
this.user = user;
}
This annotation also works for data tables that are transformed to a list of beans.
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
value |
Copyright © 2017. All Rights Reserved.