Cucumber-JVM ParameterType transformation for complex DataTable objects
0 reputation · 30 Aug 2025, 05:14 UTC
Cucumber-JVM allows the definition of custom ParameterType mappings to convert Gherkin string captures into strongly typed Java objects. This mechanism simplifies step definitions by removing manual parsing logic from the method body.
While ParameterType works for individual step arguments, there is uncertainty regarding its application to DataTable entries. When a Gherkin step provides a table, the data is typically handled as a DataTable object or mapped via a DataTableType. It is unclear if a defined ParameterType for a specific class is automatically leveraged when that class is used as a target type within a DataTableType transformation.
- Does Cucumber-JVM reuse
ParameterTypedefinitions when resolving types within aDataTableTypemapping? - If they are independent, what is the recommended configuration to avoid duplicating transformation logic for the same domain object across both single parameters and tables?