Packages

c

akka.http.javadsl.testkit

TestRouteResult

abstract class TestRouteResult extends AnyRef

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.

Source
TestRouteResult.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestRouteResult
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new TestRouteResult(_result: Future[RouteResult], awaitAtMost: FiniteDuration)(implicit ec: ExecutionContext, materializer: Materializer)

Abstract Value Members

  1. abstract def assertEquals(expected: Int, actual: Int, message: String): Unit
    Attributes
    protected
  2. abstract def assertEquals(expected: AnyRef, actual: AnyRef, message: String): Unit
    Attributes
    protected
  3. abstract def assertTrue(predicate: Boolean, message: String): Unit
    Attributes
    protected
  4. abstract def fail(message: String): Unit
    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from TestRouteResult toany2stringadd[TestRouteResult] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (TestRouteResult, B)
    Implicit
    This member is added by an implicit conversion from TestRouteResult toArrowAssoc[TestRouteResult] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def assertContentType(expected: ContentType): TestRouteResult

    Assert on the content type of the response.

  8. def assertContentType(expected: String): TestRouteResult

    Assert on the content type of the response.

  9. def assertEntity(expected: String): TestRouteResult

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

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

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

  11. def assertEntityBytes(expected: ByteString): TestRouteResult

    Assert on the response entity to equal the given bytes.

  12. def assertEqualsKind(expected: Int, actual: Int, kind: String): TestRouteResult
    Attributes
    protected
  13. def assertEqualsKind(expected: AnyRef, actual: AnyRef, kind: String): TestRouteResult
    Attributes
    protected
  14. def assertHeaderExists(expected: HttpHeader): TestRouteResult

    Assert that a given header instance exists in the response.

  15. def assertHeaderExists(name: String, value: String): TestRouteResult

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

  16. def assertHeaderKindExists(name: String): TestRouteResult

    Assert that a header of the given type exists.

  17. def assertHeaderKindNotExists(name: String): TestRouteResult

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

  18. def assertMediaType(expected: MediaType): TestRouteResult

    Assert on the media type of the response.

  19. def assertMediaType(expected: String): TestRouteResult

    Assert on the media type of the response.

  20. def assertRejections(expectedRejections: Rejection*): TestRouteResult
    Annotations
    @varargs()
  21. def assertStatusCode(expected: StatusCode): TestRouteResult

    Assert on the status code.

  22. def assertStatusCode(expected: Int): TestRouteResult

    Assert on the numeric status code.

  23. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  24. def contentType: ContentType

    Returns the response's content-type

  25. def contentTypeString: String

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

  26. def ensuring(cond: (TestRouteResult) => Boolean, msg: => Any): TestRouteResult
    Implicit
    This member is added by an implicit conversion from TestRouteResult toEnsuring[TestRouteResult] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  27. def ensuring(cond: (TestRouteResult) => Boolean): TestRouteResult
    Implicit
    This member is added by an implicit conversion from TestRouteResult toEnsuring[TestRouteResult] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  28. def ensuring(cond: Boolean, msg: => Any): TestRouteResult
    Implicit
    This member is added by an implicit conversion from TestRouteResult toEnsuring[TestRouteResult] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  29. def ensuring(cond: Boolean): TestRouteResult
    Implicit
    This member is added by an implicit conversion from TestRouteResult toEnsuring[TestRouteResult] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  30. def entity[T](unmarshaller: Unmarshaller[HttpEntity, T]): T

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

  31. lazy val entity: Strict

    Returns the strictified entity of the response.

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

  32. def entityBytes: ByteString

    Returns the bytes of the response entity

  33. def entityString: String

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

  34. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  35. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  36. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  37. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  38. def header[T >: Null <: HttpHeader](clazz: Class[T]): T

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

  39. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  40. def mediaType: MediaType

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

  41. def mediaTypeString: String

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

  42. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  43. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  44. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  45. def rejection: Rejection

    Expects the route to have been rejected with a single rejection.

    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.

  46. def rejections: List[Rejection]

    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.

    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.

  47. lazy val response: HttpResponse

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

  48. def status: StatusCode

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

  49. def statusCode: Int

    Returns the numeric status code of the response.

  50. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  51. def toString(): String
    Definition Classes
    AnyRef → Any
  52. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  53. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  54. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from TestRouteResult toStringFormat[TestRouteResult] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (TestRouteResult, B)
    Implicit
    This member is added by an implicit conversion from TestRouteResult toArrowAssoc[TestRouteResult] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromTestRouteResult to any2stringadd[TestRouteResult]

Inherited by implicit conversion StringFormat fromTestRouteResult to StringFormat[TestRouteResult]

Inherited by implicit conversion Ensuring fromTestRouteResult to Ensuring[TestRouteResult]

Inherited by implicit conversion ArrowAssoc fromTestRouteResult to ArrowAssoc[TestRouteResult]

Ungrouped