Package akka.http.scaladsl.testkit
Interface RouteTest
-
- All Superinterfaces:
MarshallingTestUtils
,RequestBuilding
,RouteTestResultComponent
,TransformerPipelineSupport
,WSTestRequestBuilding
- All Known Subinterfaces:
ScalatestRouteTest
,Specs2RouteTest
public interface RouteTest extends RequestBuilding, WSTestRequestBuilding, RouteTestResultComponent, MarshallingTestUtils
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RouteTest.DefaultHostInfo
static class
RouteTest.DefaultHostInfo$
static class
RouteTest.TildeArrow<A,B>
static class
RouteTest.TildeArrow$
static class
RouteTest.TildeBangArrow<A,B>
static class
RouteTest.TildeBangArrow$
static class
RouteTest.WithTransformation2
-
Nested classes/interfaces inherited from interface akka.http.scaladsl.client.RequestBuilding
RequestBuilding.RequestBuilder
-
Nested classes/interfaces inherited from interface akka.http.scaladsl.testkit.RouteTestResultComponent
RouteTestResultComponent.RouteTestResult
-
Nested classes/interfaces inherited from interface akka.http.scaladsl.client.TransformerPipelineSupport
TransformerPipelineSupport.WithTransformation<A>, TransformerPipelineSupport.WithTransformerConcatenation<A,B>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
actorSystemNameFrom(java.lang.Class<?> clazz)
HttpCharset
charset()
scala.Option<HttpCharset>
charsetOption()
<T> scala.Function1<RouteTestResultComponent.RouteTestResult,T>
check(scala.Function0<T> body)
scala.collection.immutable.Seq<HttpEntity.ChunkStreamPart>
chunks()
akka.stream.scaladsl.Source<HttpEntity.ChunkStreamPart,java.lang.Object>
chunksStream()
void
cleanUp()
java.lang.String
closingExtension()
ContentType
contentType()
akka.actor.ActorSystem
createActorSystem()
Override to supply a custom ActorSystemRouteTest.DefaultHostInfo$
DefaultHostInfo()
Accessor for nested Scala object<T> T
entityAs(Unmarshaller<HttpEntity,T> evidence$1, scala.reflect.ClassTag<T> evidence$2, scala.concurrent.duration.Duration timeout)
scala.concurrent.ExecutionContextExecutor
executor()
void
expectWebSocketUpgradeWithProtocol(scala.Function1<java.lang.String,scala.runtime.BoxedUnit> body)
Asserts that the received response is a WebSocket upgrade response and the extracts the chosen subprotocol and passes it to the handler.boolean
handled()
scala.Option<HttpHeader>
header(java.lang.String name)
<T extends HttpHeader>
scala.Option<T>header(scala.reflect.ClassTag<T> evidence$5)
scala.collection.immutable.Seq<HttpHeader>
headers()
boolean
isWebSocketUpgrade()
akka.stream.Materializer
materializer()
MediaType
mediaType()
HttpResponse
rawResponse()
Rejection
rejection()
scala.collection.immutable.Seq<Rejection>
rejections()
HttpResponse
response()
<T> T
responseAs(Unmarshaller<HttpResponse,T> evidence$3, scala.reflect.ClassTag<T> evidence$4, scala.concurrent.duration.Duration timeout)
HttpEntity
responseEntity()
java.lang.Object
responseSafe()
RouteTestResultComponent.RouteTestResult
result()
scala.Function1<RouteTestResultComponent.RouteTestResult,RouteTestResultComponent.RouteTestResult>
runRoute()
A dummy that can be used as~> runRoute
to run the route but without blocking for the result.StatusCode
status()
akka.actor.ActorSystem
system()
com.typesafe.config.Config
testConfig()
java.lang.String
testConfigSource()
RouteTest.TildeArrow$
TildeArrow()
Accessor for nested Scala objectRouteTest.TildeBangArrow$
TildeBangArrow()
Accessor for nested Scala objectscala.collection.immutable.Seq<HttpHeader>
trailer()
-
Methods inherited from interface akka.http.scaladsl.testkit.MarshallingTestUtils
marshal, marshallingTimeout, marshalToResponse, marshalToResponseForRequestAccepting, unmarshal, unmarshalValue
-
Methods inherited from interface akka.http.scaladsl.client.RequestBuilding
addAttribute, addCredentials, addHeader, addHeader, addHeaders, Delete, Get, Head, header2AddHeader, logRequest, logRequest, mapHeaders, Options, Patch, Post, Put, removeHeader, removeHeader, removeHeader, removeHeaders
-
Methods inherited from interface akka.http.scaladsl.testkit.RouteTestResultComponent
failTest
-
Methods inherited from interface akka.http.scaladsl.client.TransformerPipelineSupport
logValue, logValue
-
Methods inherited from interface akka.http.scaladsl.testkit.WSTestRequestBuilding
WS
-
-
-
-
Method Detail
-
DefaultHostInfo
RouteTest.DefaultHostInfo$ DefaultHostInfo()
Accessor for nested Scala object- Returns:
- (undocumented)
-
TildeArrow
RouteTest.TildeArrow$ TildeArrow()
Accessor for nested Scala object- Returns:
- (undocumented)
-
TildeBangArrow
RouteTest.TildeBangArrow$ TildeBangArrow()
Accessor for nested Scala object- Returns:
- (undocumented)
-
createActorSystem
akka.actor.ActorSystem createActorSystem()
Override to supply a custom ActorSystem
-
actorSystemNameFrom
java.lang.String actorSystemNameFrom(java.lang.Class<?> clazz)
-
testConfigSource
java.lang.String testConfigSource()
-
testConfig
com.typesafe.config.Config testConfig()
- Specified by:
testConfig
in interfaceMarshallingTestUtils
-
system
akka.actor.ActorSystem system()
-
executor
scala.concurrent.ExecutionContextExecutor executor()
-
materializer
akka.stream.Materializer materializer()
-
cleanUp
void cleanUp()
-
result
RouteTestResultComponent.RouteTestResult result()
-
check
<T> scala.Function1<RouteTestResultComponent.RouteTestResult,T> check(scala.Function0<T> body)
-
responseSafe
java.lang.Object responseSafe()
-
handled
boolean handled()
-
response
HttpResponse response()
-
responseEntity
HttpEntity responseEntity()
-
rawResponse
HttpResponse rawResponse()
-
chunks
scala.collection.immutable.Seq<HttpEntity.ChunkStreamPart> chunks()
-
chunksStream
akka.stream.scaladsl.Source<HttpEntity.ChunkStreamPart,java.lang.Object> chunksStream()
-
entityAs
<T> T entityAs(Unmarshaller<HttpEntity,T> evidence$1, scala.reflect.ClassTag<T> evidence$2, scala.concurrent.duration.Duration timeout)
-
responseAs
<T> T responseAs(Unmarshaller<HttpResponse,T> evidence$3, scala.reflect.ClassTag<T> evidence$4, scala.concurrent.duration.Duration timeout)
-
contentType
ContentType contentType()
-
mediaType
MediaType mediaType()
-
charsetOption
scala.Option<HttpCharset> charsetOption()
-
charset
HttpCharset charset()
-
headers
scala.collection.immutable.Seq<HttpHeader> headers()
-
header
<T extends HttpHeader> scala.Option<T> header(scala.reflect.ClassTag<T> evidence$5)
-
header
scala.Option<HttpHeader> header(java.lang.String name)
-
status
StatusCode status()
-
closingExtension
java.lang.String closingExtension()
-
trailer
scala.collection.immutable.Seq<HttpHeader> trailer()
-
rejections
scala.collection.immutable.Seq<Rejection> rejections()
-
rejection
Rejection rejection()
-
isWebSocketUpgrade
boolean isWebSocketUpgrade()
-
expectWebSocketUpgradeWithProtocol
void expectWebSocketUpgradeWithProtocol(scala.Function1<java.lang.String,scala.runtime.BoxedUnit> body)
Asserts that the received response is a WebSocket upgrade response and the extracts the chosen subprotocol and passes it to the handler.- Parameters:
body
- (undocumented)
-
runRoute
scala.Function1<RouteTestResultComponent.RouteTestResult,RouteTestResultComponent.RouteTestResult> runRoute()
A dummy that can be used as~> runRoute
to run the route but without blocking for the result. The result of the pipeline is the result that can later be checked withcheck
. See the "separate running route from checking" example from ScalatestRouteTestSpec.scala.- Returns:
- (undocumented)
-
-