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
Cucumber is not able to convert DataTable to Map<String, Boolean>.
It fails with following error:
io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to Map<java.lang.String, java.lang.Boolean>.
[error] Please review these problems:
[error]
[error] - There was no table entry transformer registered for java.lang.Boolean.
[error] Please consider registering a table entry transformer.
[error]
[error] - There was no table cell transformer registered for java.lang.Boolean.
[error] Please consider registering a table cell transformer.
[error]
[error] - There was no default table cell transformer registered to transform java.lang.Boolean.
[error] Please consider registering a default table cell transformer.
[error]
✅ What did you expect to see?
To be honest, I'm not sure I personally expect Cucumber to handle this case. But I admit it would be nice to handle conversion to Boolean as other types are handled like String or Integer for instance.
📦 Which tool/library version are you using?
Cucumber Core 7.7.0.
🔬 How could we reproduce it?
Scenario: As Map of booleanGiven the following table as Scala Map with boolean
| row1 | true | | row2 | | | row3 | false |
@Given("the following table as Scala Map with boolean")
publicvoidmy_step(DataTabletable) {
Map<String, Boolean> data = table.asMap(String.class, Boolean.class)
Map<String, Boolean> expected = Map.ofEntries(
entry("row1", Boolean.TRUE)
entry("row2", null),
entry("row3", Boolean.FALSE)
)
assert(data == expected)
}
Yeah. That's the right spot. Not sure why I never added booleans. Note that they should be replaceable to facilitate converters that work with other boolean strings like yes/no ect. That's what the true flag is for IIRC.
👓 What did you see?
Cucumber is not able to convert
DataTable
toMap<String, Boolean>
.It fails with following error:
✅ What did you expect to see?
To be honest, I'm not sure I personally expect Cucumber to handle this case. But I admit it would be nice to handle conversion to
Boolean
as other types are handled likeString
orInteger
for instance.📦 Which tool/library version are you using?
Cucumber Core 7.7.0.
🔬 How could we reproduce it?
📚 Any additional context?
The issue was actually raised on Scala implementation in the first place: cucumber/cucumber-jvm-scala#322
The text was updated successfully, but these errors were encountered: