Class RouteTest
java.lang.Object
org.apache.pekko.http.javadsl.server.directives.BasicDirectives
org.apache.pekko.http.javadsl.server.directives.CacheConditionDirectives
org.apache.pekko.http.javadsl.server.directives.CodingDirectives
org.apache.pekko.http.javadsl.server.directives.CookieDirectives
org.apache.pekko.http.javadsl.server.directives.DebuggingDirectives
org.apache.pekko.http.javadsl.server.directives.ExecutionDirectives
org.apache.pekko.http.javadsl.server.directives.FileAndResourceDirectives
org.apache.pekko.http.javadsl.server.directives.FileUploadDirectives
org.apache.pekko.http.javadsl.server.directives.FormFieldDirectives
org.apache.pekko.http.javadsl.server.directives.FutureDirectives
org.apache.pekko.http.javadsl.server.directives.HeaderDirectives
org.apache.pekko.http.javadsl.server.directives.AttributeDirectives
org.apache.pekko.http.javadsl.server.directives.HostDirectives
org.apache.pekko.http.javadsl.server.directives.MarshallingDirectives
org.apache.pekko.http.javadsl.server.directives.MethodDirectives
org.apache.pekko.http.javadsl.server.directives.MiscDirectives
org.apache.pekko.http.javadsl.server.directives.ParameterDirectives
org.apache.pekko.http.javadsl.server.directives.PathDirectives
org.apache.pekko.http.javadsl.server.directives.RangeDirectives
org.apache.pekko.http.javadsl.server.directives.RespondWithDirectives
org.apache.pekko.http.javadsl.server.directives.RouteDirectives
org.apache.pekko.http.javadsl.server.directives.SchemeDirectives
org.apache.pekko.http.javadsl.server.directives.SecurityDirectives
org.apache.pekko.http.javadsl.server.directives.WebSocketDirectives
org.apache.pekko.http.javadsl.server.directives.TimeoutDirectives
org.apache.pekko.http.javadsl.server.directives.FramedEntityStreamingDirectives
org.apache.pekko.http.javadsl.server.AllDirectives
org.apache.pekko.http.javadsl.testkit.RouteTest
- All Implemented Interfaces:
WSTestRequestBuilding
- Direct Known Subclasses:
JUnitRouteTestBase
A base class to create route tests for testing libraries. An implementation needs to provide
code to provide and shutdown an
pekko.actor.ActorSystem
, pekko.stream.Materializer
, and ExecutionContextExecutor
.
See JUnitRouteTest
for an example of a concrete implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.pekko.http.javadsl.server.directives.SecurityDirectives
SecurityDirectives.ProvidedCredentials, SecurityDirectives.ProvidedCredentials$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected scala.concurrent.duration.FiniteDuration
protected TestRouteResult
createTestRouteResult
(HttpRequest request, RouteResult result) protected abstract TestRouteResult
createTestRouteResultAsync
(HttpRequest request, scala.concurrent.Future<RouteResult> result) protected scala.concurrent.duration.FiniteDuration
protected DefaultHostInfo
scala.concurrent.ExecutionContextExecutor
abstract org.apache.pekko.stream.Materializer
runRoute
(Route route, HttpRequest request) runRoute
(Route route, HttpRequest request, DefaultHostInfo defaultHostInfo) runRouteClientServer
(Route route, HttpRequest request) runRouteUnSealed
(Route route, HttpRequest request) runRouteUnSealed
(Route route, HttpRequest request, DefaultHostInfo defaultHostInfo) abstract org.apache.pekko.actor.ActorSystem
system()
Wraps a list of route alternatives with testing support.Wraps a list of route alternatives with testing support.Methods inherited from class org.apache.pekko.http.javadsl.server.directives.FramedEntityStreamingDirectives
attribute, authenticateBasic, authenticateBasicAsync, authenticateBasicAsyncOptional, authenticateBasicOptional, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2AsyncOptional, authenticateOAuth2Optional, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorizeAsync, authorizeAsyncWithRequestContext, authorizeWithRequestContext, cancelRejection, cancelRejections, cancelRejections, checkSameOrigin, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, completeOK, completeOKWithFuture, completeOKWithFuture, completeOKWithFuture, completeOKWithFutureString, completeOKWithFutureString, completeOKWithSource, completeOrRecoverWith, completeWith, completeWithFuture, completeWithFuture, completeWithFuture, completeWithFutureResponse, completeWithFutureStatus, completeWithFutureStatus, completeWithSource, concat, concat, conditional, conditional, conditional, conditional, cookie, decodeRequest, decodeRequestWith, decodeRequestWith, defaultContentTypeResolver, defaultDirectoryRenderer, delete, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, encodeResponse, encodeResponseWith, entity, entityAsSourceOf, extract, extractActorSystem, extractClientIP, extractCredentials, extractDataBytes, extractEntity, extractExecutionContext, extractHost, extractLog, extractMatchedPath, extractMaterializer, extractMethod, extractOfferedWsProtocols, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractRequestTimeout, extractScheme, extractSettings, extractStrictEntity, extractStrictEntity, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUri, extractWebSocketUpgrade, failWith, fileUpload, fileUploadAll, formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional, get, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, handle, handleExceptions, handleRejections, handleSync, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocol, handleWith, head, headerValue, headerValueByName, headerValueByType, headerValuePF, host, host, host, host, ignoreTrailingSlash, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContents, logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, method, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccess, optionalAttribute, optionalCookie, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF, options, overrideMethodWithParameter, parameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValue, pass, patch, path, path, path, path, path, path, pathEnd, pathEndOrSingleSlash, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathSingleSlash, pathSuffix, pathSuffix, pathSuffix, pathSuffix, pathSuffixTest, pathSuffixTest, pathSuffixTest, pathSuffixTest, post, provide, put, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, recoverRejections, recoverRejectionsWith, redirect, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissing, reject, reject, reject, rejectEmptyResponse, request, requestEncodedWith, requestEntityEmpty, requestEntityPresent, respondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders, responseEncodingAccepted, route, route, scheme, selectPreferredLanguage, setCookie, setCookie, storeUploadedFile, storeUploadedFiles, toStrictEntity, toStrictEntity, toStrictEntity, toStrictEntity, validate, withExecutionContext, withLog, withMaterializer, withoutRequestTimeout, withoutSizeLimit, withPrecompressedMediaTypeSupport, withRangeSupport, withRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponse, withSettings, withSizeLimit
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.TimeoutDirectives
extractRequestTimeout, withoutRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponse
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.WebSocketDirectives
extractOfferedWsProtocols, extractWebSocketUpgrade, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocol
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.SecurityDirectives
authenticateBasic, authenticateBasicAsync, authenticateBasicAsyncOptional, authenticateBasicOptional, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2AsyncOptional, authenticateOAuth2Optional, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorizeAsync, authorizeAsyncWithRequestContext, authorizeWithRequestContext, extractCredentials
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.SchemeDirectives
extractScheme, scheme
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.RouteDirectives
complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, completeOK, completeOKWithFuture, completeOKWithFuture, completeOKWithFuture, completeOKWithFutureString, completeOKWithFutureString, completeWithFuture, completeWithFuture, completeWithFuture, completeWithFutureResponse, completeWithFutureStatus, completeWithFutureStatus, concat, concat, failWith, handle, handleSync, redirect, reject, reject, reject, route, route
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.RespondWithDirectives
respondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.RangeDirectives
withRangeSupport
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.PathDirectives
ignoreTrailingSlash, path, path, path, path, path, path, pathEnd, pathEndOrSingleSlash, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathSingleSlash, pathSuffix, pathSuffix, pathSuffix, pathSuffix, pathSuffixTest, pathSuffixTest, pathSuffixTest, pathSuffixTest, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissing
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.ParameterDirectives
parameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValue
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.MiscDirectives
extractClientIP, rejectEmptyResponse, requestEntityEmpty, requestEntityPresent, selectPreferredLanguage, validate, withoutSizeLimit, withSizeLimit
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.MethodDirectives
delete, extractMethod, get, head, method, options, overrideMethodWithParameter, patch, post, put
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.MarshallingDirectives
completeWith, entity, handleWith, request
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.HostDirectives
extractHost, host, host, host, host
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.AttributeDirectives
attribute, optionalAttribute
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.HeaderDirectives
checkSameOrigin, headerValue, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.FutureDirectives
completeOrRecoverWith, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccess
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.FormFieldDirectives
formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.FileUploadDirectives
fileUpload, fileUploadAll, storeUploadedFile, storeUploadedFiles
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.FileAndResourceDirectives
defaultContentTypeResolver, defaultDirectoryRenderer, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContents
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.ExecutionDirectives
handleExceptions, handleRejections
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.DebuggingDirectives
logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.CookieDirectives
cookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookie
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.CodingDirectives
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.CacheConditionDirectives
conditional, conditional, conditional, conditional
Methods inherited from class org.apache.pekko.http.javadsl.server.directives.BasicDirectives
cancelRejection, cancelRejections, cancelRejections, extract, extractActorSystem, extractDataBytes, extractEntity, extractExecutionContext, extractLog, extractMatchedPath, extractMaterializer, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractSettings, extractStrictEntity, extractStrictEntity, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUri, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, pass, provide, recoverRejections, recoverRejectionsWith, toStrictEntity, toStrictEntity, toStrictEntity, toStrictEntity, withExecutionContext, withLog, withMaterializer, withSettings
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.pekko.http.javadsl.testkit.WSTestRequestBuilding
WS, WS
-
Constructor Details
-
RouteTest
public RouteTest()
-
-
Method Details
-
awaitDuration
protected scala.concurrent.duration.FiniteDuration awaitDuration() -
createTestRouteResult
-
createTestRouteResultAsync
protected abstract TestRouteResult createTestRouteResultAsync(HttpRequest request, scala.concurrent.Future<RouteResult> result) -
defaultAwaitDuration
protected scala.concurrent.duration.FiniteDuration defaultAwaitDuration() -
defaultHostInfo
-
executionContext
public scala.concurrent.ExecutionContextExecutor executionContext() -
materializer
public abstract org.apache.pekko.stream.Materializer materializer() -
runRoute
-
runRoute
-
runRouteClientServer
-
runRouteUnSealed
-
runRouteUnSealed
public TestRouteResult runRouteUnSealed(Route route, HttpRequest request, DefaultHostInfo defaultHostInfo) -
system
public abstract org.apache.pekko.actor.ActorSystem system() -
testRoute
Wraps a list of route alternatives with testing support.- Parameters:
first
- (undocumented)others
- (undocumented)- Returns:
- (undocumented)
-
testRoute
Wraps a list of route alternatives with testing support.- Parameters:
first
- (undocumented)others
- (undocumented)- Returns:
- (undocumented)
-