Skip to content

Commit f555eef

Browse files
committed
Use asScala methods in DataTableType tests
1 parent e8a3aa5 commit f555eef

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

scala/sources/src/test/scala/tests/datatables/DataTableTypeSteps.scala

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package tests.datatables
33
import io.cucumber.scala.{EN, ScalaDsl}
44
import java.util.{List => JList, Map => JMap}
55

6+
import io.cucumber.scala.Implicits._
67
import io.cucumber.datatable.DataTable
78

89
import scala.jdk.CollectionConverters._
@@ -90,9 +91,7 @@ class DataTableTypeSteps extends ScalaDsl with EN {
9091

9192
Given("the following authors as entries with empty, as table") { (authors: DataTable) =>
9293
_authors = authors
93-
.asList[AuthorWithEmpty](classOf[AuthorWithEmpty])
94-
.asScala
95-
.toSeq
94+
.asScalaRawList[AuthorWithEmpty]
9695
.map(_.toAuthor)
9796
}
9897

@@ -112,9 +111,7 @@ class DataTableTypeSteps extends ScalaDsl with EN {
112111

113112
Given("the following authors as rows with empty, as table") { (authors: DataTable) =>
114113
_authors = authors
115-
.asList[AuthorRowWithEmpty](classOf[AuthorRowWithEmpty])
116-
.asScala
117-
.toSeq
114+
.asScalaRawList[AuthorRowWithEmpty]
118115
.map(_.toAuthor)
119116
}
120117

@@ -144,19 +141,13 @@ class DataTableTypeSteps extends ScalaDsl with EN {
144141

145142
Given("the following authors as cells with empty, as table as map") { (authors: DataTable) =>
146143
_authors = authors
147-
.asMaps[String, AuthorCellWithEmpty](classOf[String], classOf[AuthorCellWithEmpty])
148-
.asScala
149-
.toSeq
150-
.map(_.asScala)
144+
.asScalaRawMaps[String, AuthorCellWithEmpty]
151145
.map(line => Author(line("name").cell, line("surname").cell, line("famousBook").cell))
152146
}
153147

154148
Given("the following authors as cells with empty, as table as list") { (authors: DataTable) =>
155149
_authors = authors
156-
.asLists[AuthorCellWithEmpty](classOf[AuthorCellWithEmpty])
157-
.asScala
158-
.toSeq
159-
.map(_.asScala)
150+
.asScalaRawLists[AuthorCellWithEmpty]
160151
.map(line => Author(line(0).cell, line(1).cell, line(2).cell))
161152
}
162153

0 commit comments

Comments
 (0)