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 classstatic classstatic classstatic classstatic classstatic classstatic classNested classes/interfaces inherited from interface org.apache.pekko.http.scaladsl.client.RequestBuilding
RequestBuilding.RequestBuilderNested classes/interfaces inherited from interface org.apache.pekko.http.scaladsl.testkit.RouteTestResultComponent
RouteTestResultComponent.RouteTestResultNested 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> voidcleanUp()org.apache.pekko.actor.ActorSystemOverride to supply a custom ActorSystemAccessor for nested Scala object<T> TentityAs(Unmarshaller<HttpEntity, T> evidence$1, scala.reflect.ClassTag<T> evidence$2, scala.concurrent.duration.Duration timeout) scala.concurrent.ExecutionContextExecutorexecutor()voidexpectWebSocketUpgradeWithProtocol(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.booleanhandled()scala.Option<HttpHeader><T extends HttpHeader>
scala.Option<T>header(scala.reflect.ClassTag<T> evidence$5) scala.collection.immutable.Seq<HttpHeader>headers()booleanorg.apache.pekko.stream.Materializerscala.collection.immutable.Seq<Rejection>response()<T> TresponseAs(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~> runRouteto run the route but without blocking for the result.status()org.apache.pekko.actor.ActorSystemsystem()com.typesafe.config.ConfigAccessor 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, unmarshalValueMethods 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, removeHeadersMethods inherited from interface org.apache.pekko.http.scaladsl.testkit.RouteTestResultComponent
failTestMethods inherited from interface org.apache.pekko.http.scaladsl.client.TransformerPipelineSupport
logValue, logValueMethods 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:
testConfigin 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~> runRouteto 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)
-