add extractActorSystem directive (#21097)
This commit is contained in:
parent
07c6332a22
commit
3e2bdb55a3
8 changed files with 96 additions and 2 deletions
|
|
@ -862,4 +862,17 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
//#
|
||||
}
|
||||
|
||||
"extractActorSystem-example" in {
|
||||
//#extractActorSystem-example
|
||||
val route = extractActorSystem { actorSystem =>
|
||||
complete(s"Actor System extracted, hash=${actorSystem.hashCode()}")
|
||||
}
|
||||
|
||||
// tests:
|
||||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual s"Actor System extracted, hash=${system.hashCode()}"
|
||||
}
|
||||
//#
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue