Merge pull request #19118 from Softwire/wip-18567-unmarshallers-for-csv-number-sequences

!htp #18567 Added unmarshallers for CSV integer sequences
This commit is contained in:
Roland Kuhn 2015-12-13 17:48:27 +01:00
commit 0f74a0e02b
3 changed files with 82 additions and 22 deletions

View file

@ -7,7 +7,7 @@ package directives
import org.scalatest.{ FreeSpec, Inside }
import akka.http.scaladsl.unmarshalling.Unmarshaller.HexInt
import akka.http.scaladsl.unmarshalling.Unmarshaller.CsvString
import akka.http.scaladsl.unmarshalling.Unmarshaller.CsvStringSeq
class ParameterDirectivesSpec extends FreeSpec with GenericRoutingSpec with Inside {
"when used with 'as[Int]' the parameter directive should" - {
@ -53,9 +53,9 @@ class ParameterDirectivesSpec extends FreeSpec with GenericRoutingSpec with Insi
}
}
"when used with 'as(CsvString)' the parameter directive should" - {
"when used with 'as(CsvStringSeq)' the parameter directive should" - {
val route =
parameter("names".as(CsvString)) { names
parameter("names".as(CsvStringSeq)) { names
complete(s"The parameters are ${names.mkString(", ")}")
}