You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
When using Data Tables to pass a set of values to the StepDefs, the Kotlin types Map and List don't seem to be understood by TypeFactory.constructTypeInner(), resulting in the foollowing exception: io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to Map<java.lang.String, ? extends java.util.Map<java.lang.String, java.lang.String>>. Please register a DataTableType with a TableEntryTransformer or TableCellTransformer for ? extends java.util.Map<java.lang.String, java.lang.String>
Using java.util.Map instead of kotlin.collections.Map fixes the problem
To Reproduce
Steps to reproduce the behavior:
A step with a DataTable, for example:
Scenario Outline: Filter on status "<status>"
Given orders with an order item and the following attributes:
| | expected | quantityRequested | quantityShipped |
| 101 | Status.REGISTERED | 10 | 0 |
| 102 | Status.SHIPPED | 10 | 10 |
A StepDef (in Kotlin) expecting a Map<String, Map<String, String>>:
@Given("orders with an order item and the following attributes:")
fun statusFilterOrdersInEs(attributes: Map<String, Map<String, String>>)
This StepDef does not work.
Work around
The following StepDef does work:
@Given("orders with an order item and the following attributes:")
fun statusFilterOrdersInEs(attributes: java.util.Map<String, java.util.Map<String, String>>)
(providing explicit Java types)
Expected behavior
DataTable should be translated into the expected types (Kotlin Collections).
Context & Motivation
We are using DataTables to set up state in our Kotlin service, in order to test logic in this service.
Screenshots
N/A
Your Environment
Versions used: cucumber-java8 v4.8.0 (with datatable v1.1.14). Can also be reproduced when using datatable v3.0.0 explicitly.
Operating System and version: MacOs Mojave
Build tool: IntelliJ / Maven / JUnit
Kotlin version: 1.3.61
Java version: 1.8
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
A clear and concise description of what the bug is.
When using Data Tables to pass a set of values to the StepDefs, the Kotlin types Map and List don't seem to be understood by TypeFactory.constructTypeInner(), resulting in the foollowing exception:
io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to Map<java.lang.String, ? extends java.util.Map<java.lang.String, java.lang.String>>. Please register a DataTableType with a TableEntryTransformer or TableCellTransformer for ? extends java.util.Map<java.lang.String, java.lang.String>
Using java.util.Map instead of kotlin.collections.Map fixes the problem
To Reproduce
Steps to reproduce the behavior:
Map<String, Map<String, String>>
:This StepDef does not work.
Work around
The following StepDef does work:
(providing explicit Java types)
Expected behavior
DataTable should be translated into the expected types (Kotlin Collections).
Context & Motivation
We are using DataTables to set up state in our Kotlin service, in order to test logic in this service.
Screenshots
N/A
Your Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: