Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.15 KB

upgrade_v6.md

File metadata and controls

34 lines (23 loc) · 1.15 KB

Upgrading from 5.x to 6.x

Upgrading from v5 should be straightforward. Prior to upgrading to v6.0.0 upgrade to v5.7.0 and stop using all deprecated features. Some features will log a deprecation warning.

See also:

Map DataTables to Scala types

You can now map DataTables to Scala collection types using additional asScalaXxx methods on the DataTable class.

The benefit of using Scala types if that you will be handling Options instead of potentially null values in the Java collections.

For instance with asScalaMaps:

import io.cucumber.scala.{ScalaDsl, EN}
import io.cucumber.scala.Implicits._

class StepDefs extends ScalaDsl with EN {

  Given("the following table as List of Map") { (table: DataTable) =>
    val scalaTable: Seq[Map[String, Option[Int]]] = table.asScalaMaps[String, Int]
    // Do something
  }

}

See the DataTable documentation for more details.