TestRouteResult

org.apache.pekko.http.javadsl.testkit.TestRouteResult
abstract class TestRouteResult(_result: Future[RouteResult], awaitAtMost: FiniteDuration)(implicit ec: ExecutionContext, materializer: Materializer)

A wrapper for route results.

To support the testkit API, a third-party testing library needs to implement this class and provide implementations for the abstract assertion methods.

Attributes

Source
TestRouteResult.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

protected def assertEquals(expected: AnyRef, actual: AnyRef, message: String): Unit

Attributes

Source
TestRouteResult.scala
protected def assertEquals(expected: Int, actual: Int, message: String): Unit

Attributes

Source
TestRouteResult.scala
protected def assertTrue(predicate: Boolean, message: String): Unit

Attributes

Source
TestRouteResult.scala
protected def fail(message: String): Unit

Attributes

Source
TestRouteResult.scala

Concrete methods

Assert on the content type of the response.

Assert on the content type of the response.

Attributes

Source
TestRouteResult.scala

Assert on the content type of the response.

Assert on the content type of the response.

Attributes

Source
TestRouteResult.scala

Assert on the response entity to be a UTF8 representation of the given string.

Assert on the response entity to be a UTF8 representation of the given string.

Attributes

Source
TestRouteResult.scala
def assertEntityAs[T <: AnyRef](unmarshaller: Unmarshaller[HttpEntity, T], expected: T): TestRouteResult

Assert on the response entity to equal the given object after applying an pekko.http.javadsl.unmarshalling.Unmarshaller.

Assert on the response entity to equal the given object after applying an pekko.http.javadsl.unmarshalling.Unmarshaller.

Attributes

Source
TestRouteResult.scala

Assert on the response entity to equal the given bytes.

Assert on the response entity to equal the given bytes.

Attributes

Source
TestRouteResult.scala
protected def assertEqualsKind(expected: AnyRef, actual: AnyRef, kind: String): TestRouteResult

Attributes

Source
TestRouteResult.scala
protected def assertEqualsKind(expected: Int, actual: Int, kind: String): TestRouteResult

Attributes

Source
TestRouteResult.scala

Assert that a header of the given name and value exists.

Assert that a header of the given name and value exists.

Attributes

Source
TestRouteResult.scala

Assert that a given header instance exists in the response.

Assert that a given header instance exists in the response.

Attributes

Source
TestRouteResult.scala

Assert that a header of the given type exists.

Assert that a header of the given type exists.

Attributes

Source
TestRouteResult.scala

Assert that a header of the given type does not exist.

Assert that a header of the given type does not exist.

Attributes

Source
TestRouteResult.scala

Assert on the media type of the response.

Assert on the media type of the response.

Attributes

Source
TestRouteResult.scala

Assert on the media type of the response.

Assert on the media type of the response.

Attributes

Source
TestRouteResult.scala
def assertRejections(expectedRejections: Rejection*): TestRouteResult

Attributes

Source
TestRouteResult.scala

Assert on the numeric status code.

Assert on the numeric status code.

Attributes

Source
TestRouteResult.scala

Assert on the status code.

Assert on the status code.

Attributes

Source
TestRouteResult.scala

Returns the response's content-type

Returns the response's content-type

Attributes

Source
TestRouteResult.scala

Returns a string representation of the response's content-type

Returns a string representation of the response's content-type

Attributes

Source
TestRouteResult.scala
def entity[T](unmarshaller: Unmarshaller[HttpEntity, T]): T

Returns the entity of the response unmarshalled with the given Unmarshaller.

Returns the entity of the response unmarshalled with the given Unmarshaller.

Attributes

Source
TestRouteResult.scala

Returns the bytes of the response entity

Returns the bytes of the response entity

Attributes

Source
TestRouteResult.scala

Returns the entity of the response interpreted as an UTF-8 encoded string.

Returns the entity of the response interpreted as an UTF-8 encoded string.

Attributes

Source
TestRouteResult.scala
def header[T >: Null <: HttpHeader](clazz: Class[T]): T

Returns the first header of the response which is of the given class.

Returns the first header of the response which is of the given class.

Attributes

Source
TestRouteResult.scala

Returns the media-type of the response's content-type

Returns the media-type of the response's content-type

Attributes

Source
TestRouteResult.scala

Returns a string representation of the media-type of the response's content-type

Returns a string representation of the media-type of the response's content-type

Attributes

Source
TestRouteResult.scala

Expects the route to have been rejected with a single rejection. Fails the test if the route completes with a response, or is rejected with 0 or >1 rejections.

Expects the route to have been rejected with a single rejection. Fails the test if the route completes with a response, or is rejected with 0 or >1 rejections.

Attributes

Source
TestRouteResult.scala

Expects the route to have been rejected, returning the list of rejections, or empty list if the route was rejected with an empty rejection list. Fails the test if the route completes with a response rather than having been rejected.

Expects the route to have been rejected, returning the list of rejections, or empty list if the route was rejected with an empty rejection list. Fails the test if the route completes with a response rather than having been rejected.

Attributes

Source
TestRouteResult.scala

Returns the pekko.http.javadsl.model.StatusCode of the response.

Returns the pekko.http.javadsl.model.StatusCode of the response.

Attributes

Source
TestRouteResult.scala

Returns the numeric status code of the response.

Returns the numeric status code of the response.

Attributes

Source
TestRouteResult.scala

Concrete fields

lazy val entity: Strict

Returns the strictified entity of the response. It will be strictified on first access.

Returns the strictified entity of the response. It will be strictified on first access.

Attributes

Source
TestRouteResult.scala

Returns a copy of the underlying response with the strictified entity.

Returns a copy of the underlying response with the strictified entity.

Attributes

Source
TestRouteResult.scala