-
-
Couldn't load subscription status.
- Fork 2k
Closed
Labels
🙏 help wantedHelp wanted - not prioritized by core teamHelp wanted - not prioritized by core teamgood first issueGood for newcomersGood for newcomers
Milestone
Description
Summary
In #1677 @ParameterType , @DataTableType and various other annotations were introduced as an improvement over using the TypeRegistryConfigurer. However these annotations are part of cucumber-java. The lambda based cucumber-java8 module doesn't have an equivalent yet.
To make this possible additional methods have to be added to io.cucumber.java8.LambdaGlue as well as java 8 equivalents of the the Java.*Definition classes and some plumbing to register them with the glue .
Expected Behavior
Using @DataTableType rather then @ParameterType as an example
public class RpnCalculatorSteps implements En {
public RpnCalculatorSteps() {
DataTableType((Map<String, String> entry) -> new RpnCalculatorSteps.Entry(
Integer.valueOf(entry.get("first")),
Integer.valueOf(entry.get("second")),
entry.get("operation")
));
DataTableType((Map<String, String> row) -> new ShoppingSteps.Grocery(
row.get("name"),
ShoppingSteps.Price.fromString(row.get("price"))
));
}
}Current Behavior
Using @DataTableType rather then @ParameterType as an example
public class TypeRegistryConfiguration implements TypeRegistryConfigurer {
@Override
public Locale locale() {
return ENGLISH;
}
@Override
public void configureTypeRegistry(TypeRegistry typeRegistry) {
typeRegistry.defineDataTableType(new DataTableType(
RpnCalculatorSteps.Entry.class,
(Map<String, String> row) -> new RpnCalculatorSteps.Entry(
Integer.valueOf(row.get("first")),
Integer.valueOf(row.get("second")),
row.get("operation")
)
));
typeRegistry.defineDataTableType(new DataTableType(
ShoppingSteps.Grocery.class,
(Map<String, String> row) -> new ShoppingSteps.Grocery(
row.get("name"),
ShoppingSteps.Price.fromString(row.get("price"))
)
));
}
}Metadata
Metadata
Assignees
Labels
🙏 help wantedHelp wanted - not prioritized by core teamHelp wanted - not prioritized by core teamgood first issueGood for newcomersGood for newcomers