=htp stop case class extraction from throwing IllegalArgumentException
This commit is contained in:
parent
000630c036
commit
d4ad6ea885
2 changed files with 26 additions and 1 deletions
|
|
@ -119,6 +119,17 @@ class BasicRouteSpecs extends RoutingSpec {
|
|||
responseAs[String] shouldEqual "Person(john,38)"
|
||||
}
|
||||
}
|
||||
"reject if case class requirements fail" in {
|
||||
case class MyValidNumber(i: Int) {
|
||||
require(i > 10)
|
||||
}
|
||||
|
||||
val abcPath = path("abc" / IntNumber).as(MyValidNumber)(echoComplete)
|
||||
|
||||
Get("/abc/5") ~> abcPath ~> check {
|
||||
rejection shouldBe a[ValidationRejection]
|
||||
}
|
||||
}
|
||||
}
|
||||
"Dynamic execution of inner routes of Directive0" should {
|
||||
"re-execute inner routes every time" in {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue