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 ClassesModifier and TypeInterfaceDescriptionstatic class
static class
static class
static class
static class
static class
static class
Nested classes/interfaces inherited from interface org.apache.pekko.http.scaladsl.client.RequestBuilding
RequestBuilding.RequestBuilder
Nested classes/interfaces inherited from interface org.apache.pekko.http.scaladsl.testkit.RouteTestResultComponent
RouteTestResultComponent.RouteTestResult
Nested classes/interfaces inherited from interface org.apache.pekko.http.scaladsl.client.TransformerPipelineSupport
TransformerPipelineSupport.WithTransformation<A>, TransformerPipelineSupport.WithTransformerConcatenation<A,
B> -
Method Summary
Modifier and TypeMethodDescriptionactorSystemNameFrom
(Class<?> clazz) charset()
scala.Option<HttpCharset>
<T> scala.Function1<RouteTestResultComponent.RouteTestResult,
T> check
(scala.Function0<T> body) scala.collection.immutable.Seq<HttpEntity.ChunkStreamPart>
chunks()
org.apache.pekko.stream.scaladsl.Source<HttpEntity.ChunkStreamPart,
Object> void
cleanUp()
org.apache.pekko.actor.ActorSystem
Override to supply a custom ActorSystemAccessor 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<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>
<T extends HttpHeader>
scala.Option<T>header
(scala.reflect.ClassTag<T> evidence$5) scala.collection.immutable.Seq<HttpHeader>
headers()
boolean
org.apache.pekko.stream.Materializer
scala.collection.immutable.Seq<Rejection>
response()
<T> T
responseAs
(Unmarshaller<HttpResponse, T> evidence$3, scala.reflect.ClassTag<T> evidence$4, scala.concurrent.duration.Duration timeout) result()
runRoute()
A dummy that can be used as~> runRoute
to run the route but without blocking for the result.status()
org.apache.pekko.actor.ActorSystem
system()
com.typesafe.config.Config
Accessor for nested Scala objectAccessor for nested Scala objectscala.collection.immutable.Seq<HttpHeader>
trailer()
Methods inherited from interface org.apache.pekko.http.scaladsl.testkit.MarshallingTestUtils
marshal, marshallingTimeout, marshalToResponse, marshalToResponseForRequestAccepting, unmarshal, unmarshalValue
Methods inherited from interface org.apache.pekko.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 org.apache.pekko.http.scaladsl.testkit.RouteTestResultComponent
failTest
Methods inherited from interface org.apache.pekko.http.scaladsl.client.TransformerPipelineSupport
logValue, logValue
Methods inherited from interface org.apache.pekko.http.scaladsl.testkit.WSTestRequestBuilding
WS
-
Method Details
-
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
org.apache.pekko.actor.ActorSystem createActorSystem()Override to supply a custom ActorSystem -
actorSystemNameFrom
-
testConfigSource
String testConfigSource() -
testConfig
com.typesafe.config.Config testConfig()- Specified by:
testConfig
in interfaceMarshallingTestUtils
-
system
org.apache.pekko.actor.ActorSystem system() -
executor
scala.concurrent.ExecutionContextExecutor executor() -
materializer
org.apache.pekko.stream.Materializer materializer() -
cleanUp
void cleanUp() -
result
-
check
-
responseSafe
Object responseSafe() -
handled
boolean handled() -
response
HttpResponse response() -
responseEntity
HttpEntity responseEntity() -
rawResponse
HttpResponse rawResponse() -
chunks
scala.collection.immutable.Seq<HttpEntity.ChunkStreamPart> chunks() -
chunksStream
org.apache.pekko.stream.scaladsl.Source<HttpEntity.ChunkStreamPart,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
-
header
-
status
StatusCode status() -
closingExtension
String closingExtension() -
trailer
scala.collection.immutable.Seq<HttpHeader> trailer() -
rejections
scala.collection.immutable.Seq<Rejection> rejections() -
rejection
Rejection rejection() -
isWebSocketUpgrade
boolean isWebSocketUpgrade() -
expectWebSocketUpgradeWithProtocol
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)
-