=doc make missing snippets errors again
This commit is contained in:
parent
ff152b816d
commit
e5b2695c5e
3 changed files with 41 additions and 42 deletions
|
|
@ -33,7 +33,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/abcdef") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "The length of the request URI is 25"
|
||||
}
|
||||
//#0extract
|
||||
//#
|
||||
}
|
||||
"0extractLog" in {
|
||||
//#0extractLog
|
||||
|
|
@ -47,7 +47,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/abcdef") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "It's amazing!"
|
||||
}
|
||||
//#0extractLog
|
||||
//#
|
||||
}
|
||||
"withMaterializer-0" in {
|
||||
//#withMaterializer-0
|
||||
|
|
@ -78,7 +78,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/special/sample") ~> route ~> check {
|
||||
responseAs[String] shouldEqual s"Materialized by ${special.##}!"
|
||||
}
|
||||
//#withMaterializer-0
|
||||
//#
|
||||
}
|
||||
"extractMaterializer-0" in {
|
||||
//#extractMaterializer-0
|
||||
|
|
@ -97,7 +97,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/sample") ~> route ~> check {
|
||||
responseAs[String] shouldEqual s"Materialized by ${materializer.##}!"
|
||||
}
|
||||
//#extractMaterializer-0
|
||||
//#
|
||||
}
|
||||
"withExecutionContext-0" in compileOnlySpec {
|
||||
//#withExecutionContext-0
|
||||
|
|
@ -126,7 +126,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/special/sample") ~> route ~> check {
|
||||
responseAs[String] shouldEqual s"Run on ${special.##}!"
|
||||
}
|
||||
//#withExecutionContext-0
|
||||
//#
|
||||
}
|
||||
"extractExecutionContext-0" in compileOnlySpec {
|
||||
//#extractExecutionContext-0
|
||||
|
|
@ -148,7 +148,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/sample") ~> route ~> check {
|
||||
responseAs[String] shouldEqual s"Run on ${system.dispatcher.##}!"
|
||||
}
|
||||
//#extractExecutionContext-0
|
||||
//#
|
||||
}
|
||||
"0withLog" in {
|
||||
//#0withLog
|
||||
|
|
@ -179,7 +179,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/special/sample") ~> route ~> check {
|
||||
responseAs[String] shouldEqual s"Logging using $special!"
|
||||
}
|
||||
//#0withLog
|
||||
//#
|
||||
}
|
||||
"withSettings-0" in compileOnlySpec {
|
||||
//#withSettings-0
|
||||
|
|
@ -210,7 +210,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/sample") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "{}"
|
||||
}
|
||||
//#withSettings-0
|
||||
//#
|
||||
}
|
||||
"textract" in {
|
||||
//#textract
|
||||
|
|
@ -227,7 +227,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/abcdef?ghi=12") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "The path is /abcdef and the query is ghi=12"
|
||||
}
|
||||
//#textract
|
||||
//#
|
||||
}
|
||||
"tprovide" in {
|
||||
//#tprovide
|
||||
|
|
@ -241,7 +241,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "Value is test and its length is 4"
|
||||
}
|
||||
//#tprovide
|
||||
//#
|
||||
}
|
||||
"0mapResponse" in {
|
||||
//#0mapResponse
|
||||
|
|
@ -253,7 +253,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/abcdef?ghi=12") ~> route ~> check {
|
||||
status shouldEqual StatusCodes.BadGateway
|
||||
}
|
||||
//#0mapResponse
|
||||
//#
|
||||
}
|
||||
"1mapResponse-advanced-json" in {
|
||||
//#1mapResponse-advanced
|
||||
|
|
@ -275,7 +275,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
def apiRoute(innerRoutes: ⇒ Route): Route =
|
||||
mapResponse(nonSuccessToEmptyJsonEntity)(innerRoutes)
|
||||
}
|
||||
//#1mapResponse-advanced
|
||||
//#
|
||||
|
||||
import StatusCodes._
|
||||
val __system = system
|
||||
|
|
@ -296,7 +296,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "{}"
|
||||
}
|
||||
//#1mapResponse-advanced
|
||||
//#
|
||||
}
|
||||
"mapRouteResult" in {
|
||||
//#mapRouteResult
|
||||
|
|
@ -320,7 +320,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
status shouldEqual StatusCodes.OK
|
||||
}
|
||||
//#mapRouteResult
|
||||
//#
|
||||
}
|
||||
"mapRouteResultFuture" in {
|
||||
//#mapRouteResultFuture
|
||||
|
|
@ -344,7 +344,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
status shouldEqual StatusCodes.OK
|
||||
header[Server] shouldEqual Some(Server("MyServer 1.0"))
|
||||
}
|
||||
//#mapRouteResultFuture
|
||||
//#
|
||||
}
|
||||
"mapResponseEntity" in {
|
||||
//#mapResponseEntity
|
||||
|
|
@ -361,7 +361,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "testabc"
|
||||
}
|
||||
//#mapResponseEntity
|
||||
//#
|
||||
}
|
||||
"mapResponseHeaders" in {
|
||||
//#mapResponseHeaders
|
||||
|
|
@ -381,7 +381,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
header("id") shouldEqual None
|
||||
header("id2").get.value shouldEqual "67890"
|
||||
}
|
||||
//#mapResponseHeaders
|
||||
//#
|
||||
}
|
||||
"mapInnerRoute" in {
|
||||
//#mapInnerRoute
|
||||
|
|
@ -404,7 +404,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "Got IllegalArgumentException 'BLIP! BLOP! Everything broke'"
|
||||
}
|
||||
//#mapInnerRoute
|
||||
//#
|
||||
}
|
||||
"mapRejections" in {
|
||||
//#mapRejections
|
||||
|
|
@ -423,7 +423,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/abc") ~> route ~> check {
|
||||
status shouldEqual StatusCodes.OK
|
||||
}
|
||||
//#mapRejections
|
||||
//#
|
||||
}
|
||||
"recoverRejections" in {
|
||||
//#recoverRejections
|
||||
|
|
@ -467,7 +467,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
status shouldEqual StatusCodes.NotFound
|
||||
responseAs[String] shouldEqual "Literally nothing to see here."
|
||||
}
|
||||
//#recoverRejections
|
||||
//#
|
||||
}
|
||||
"recoverRejectionsWith" in {
|
||||
//#recoverRejectionsWith
|
||||
|
|
@ -498,7 +498,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
status shouldEqual StatusCodes.OK
|
||||
responseAs[String] shouldEqual "Nothing to see here, move along."
|
||||
}
|
||||
//#recoverRejectionsWith
|
||||
//#
|
||||
}
|
||||
"0mapRequest" in {
|
||||
//#0mapRequest
|
||||
|
|
@ -513,7 +513,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "The request method was POST"
|
||||
}
|
||||
//#0mapRequest
|
||||
//#
|
||||
}
|
||||
"mapRequestContext" in {
|
||||
//#mapRequestContext
|
||||
|
|
@ -531,7 +531,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/abc/def/ghi") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "POST"
|
||||
}
|
||||
//#mapRequestContext
|
||||
//#
|
||||
}
|
||||
"0mapRouteResult" in {
|
||||
//#0mapRouteResult
|
||||
|
|
@ -548,7 +548,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
rejections.nonEmpty shouldEqual true
|
||||
}
|
||||
//#0mapRouteResult
|
||||
//#
|
||||
}
|
||||
"mapRouteResultPF" in {
|
||||
//#mapRouteResultPF
|
||||
|
|
@ -566,7 +566,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
rejection shouldEqual AuthorizationFailedRejection
|
||||
}
|
||||
//#mapRouteResultPF
|
||||
//#
|
||||
}
|
||||
"mapRouteResultWithPF-0" in {
|
||||
//#mapRouteResultWithPF-0
|
||||
|
|
@ -584,7 +584,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
rejection shouldEqual AuthorizationFailedRejection
|
||||
}
|
||||
//#mapRouteResultWithPF-0
|
||||
//#
|
||||
}
|
||||
"mapRouteResultWith-0" in {
|
||||
//#mapRouteResultWith-0
|
||||
|
|
@ -605,7 +605,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
rejection shouldEqual AuthorizationFailedRejection
|
||||
}
|
||||
//#mapRouteResultWith-0
|
||||
//#
|
||||
}
|
||||
"pass" in {
|
||||
//#pass
|
||||
|
|
@ -615,7 +615,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "abc"
|
||||
}
|
||||
//#pass
|
||||
//#
|
||||
}
|
||||
"0provide" in {
|
||||
//#0provide
|
||||
|
|
@ -629,7 +629,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "prefix:test"
|
||||
}
|
||||
//#0provide
|
||||
//#
|
||||
}
|
||||
"cancelRejections-filter-example" in {
|
||||
//#cancelRejections-filter-example
|
||||
|
|
@ -650,7 +650,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
rejections shouldEqual Nil
|
||||
handled shouldEqual false
|
||||
}
|
||||
//#cancelRejections-filter-example
|
||||
//#
|
||||
}
|
||||
"cancelRejection-example" in {
|
||||
//#cancelRejection-example
|
||||
|
|
@ -666,7 +666,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
rejections shouldEqual Nil
|
||||
handled shouldEqual false
|
||||
}
|
||||
//#cancelRejection-example
|
||||
//#
|
||||
}
|
||||
"extractRequest-example" in {
|
||||
//#extractRequest-example
|
||||
|
|
@ -682,7 +682,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "Request method is GET and content-type is none/none"
|
||||
}
|
||||
//#extractRequest-example
|
||||
//#
|
||||
}
|
||||
"extractSettings-examples" in {
|
||||
//#extractSettings-examples
|
||||
|
|
@ -695,7 +695,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual s"RoutingSettings.renderVanityFooter = true"
|
||||
}
|
||||
//#extractSettings-examples
|
||||
//#
|
||||
}
|
||||
"mapSettings-examples" in {
|
||||
//#mapSettings-examples
|
||||
|
|
@ -714,7 +714,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual s"RoutingSettings.fileGetConditional = false"
|
||||
}
|
||||
//#mapSettings-examples
|
||||
//#
|
||||
}
|
||||
"extractRequestContext-example" in {
|
||||
//#extractRequestContext-example
|
||||
|
|
@ -732,7 +732,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "Request method is GET and content-type is none/none"
|
||||
}
|
||||
//#extractRequestContext-example
|
||||
//#
|
||||
}
|
||||
"extractUri-example" in {
|
||||
//#extractUri-example
|
||||
|
|
@ -749,7 +749,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/test") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "Full URI: http://example.com/test"
|
||||
}
|
||||
//#extractUri-example
|
||||
//#
|
||||
}
|
||||
"mapUnmatchedPath-example" in {
|
||||
//#mapUnmatchedPath-example
|
||||
|
|
@ -778,7 +778,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/123456/abc") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "Content"
|
||||
}
|
||||
//#mapUnmatchedPath-example
|
||||
//#
|
||||
}
|
||||
"extractUnmatchedPath-example" in {
|
||||
//#extractUnmatchedPath-example
|
||||
|
|
@ -796,7 +796,7 @@ class BasicDirectivesExamplesSpec extends RoutingSpec {
|
|||
Get("/abc/456") ~> route ~> check {
|
||||
responseAs[String] shouldEqual "Unmatched: '/456'"
|
||||
}
|
||||
//#extractUnmatchedPath-example
|
||||
//#
|
||||
}
|
||||
|
||||
private def compileOnlySpec(block: => Unit) = pending
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue