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
- Alphabetic
- By Inheritance
- TestRouteResult
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new TestRouteResult(_result: Future[RouteResult], awaitAtMost: FiniteDuration)(implicit ec: ExecutionContext, materializer: Materializer)
Abstract Value Members
-
abstract
def
assertEquals(expected: Int, actual: Int, message: String): Unit
- Attributes
- protected
-
abstract
def
assertEquals(expected: AnyRef, actual: AnyRef, message: String): Unit
- Attributes
- protected
-
abstract
def
assertTrue(predicate: Boolean, message: String): Unit
- Attributes
- protected
-
abstract
def
fail(message: String): Unit
- Attributes
- protected
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from TestRouteResult to any2stringadd[TestRouteResult] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (TestRouteResult, B)
- Implicit
- This member is added by an implicit conversion from TestRouteResult to ArrowAssoc[TestRouteResult] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
assertContentType(expected: ContentType): TestRouteResult
Assert on the content type of the response.
-
def
assertContentType(expected: String): TestRouteResult
Assert on the content type of the response.
-
def
assertEntity(expected: String): TestRouteResult
Assert on the response entity to be a UTF8 representation of the given string.
-
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.
-
def
assertEntityBytes(expected: ByteString): TestRouteResult
Assert on the response entity to equal the given bytes.
-
def
assertEqualsKind(expected: Int, actual: Int, kind: String): TestRouteResult
- Attributes
- protected
-
def
assertEqualsKind(expected: AnyRef, actual: AnyRef, kind: String): TestRouteResult
- Attributes
- protected
-
def
assertHeaderExists(expected: HttpHeader): TestRouteResult
Assert that a given header instance exists in the response.
-
def
assertHeaderExists(name: String, value: String): TestRouteResult
Assert that a header of the given name and value exists.
-
def
assertHeaderKindExists(name: String): TestRouteResult
Assert that a header of the given type exists.
-
def
assertHeaderKindNotExists(name: String): TestRouteResult
Assert that a header of the given type does not exist.
-
def
assertMediaType(expected: MediaType): TestRouteResult
Assert on the media type of the response.
-
def
assertMediaType(expected: String): TestRouteResult
Assert on the media type of the response.
-
def
assertRejections(expectedRejections: Rejection*): TestRouteResult
- Annotations
- @varargs()
-
def
assertStatusCode(expected: StatusCode): TestRouteResult
Assert on the status code.
-
def
assertStatusCode(expected: Int): TestRouteResult
Assert on the numeric status code.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
contentType: ContentType
Returns the response's content-type
-
def
contentTypeString: String
Returns a string representation of the response's content-type
-
def
ensuring(cond: (TestRouteResult) ⇒ Boolean, msg: ⇒ Any): TestRouteResult
- Implicit
- This member is added by an implicit conversion from TestRouteResult to Ensuring[TestRouteResult] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (TestRouteResult) ⇒ Boolean): TestRouteResult
- Implicit
- This member is added by an implicit conversion from TestRouteResult to Ensuring[TestRouteResult] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): TestRouteResult
- Implicit
- This member is added by an implicit conversion from TestRouteResult to Ensuring[TestRouteResult] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): TestRouteResult
- Implicit
- This member is added by an implicit conversion from TestRouteResult to Ensuring[TestRouteResult] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
entity[T](unmarshaller: Unmarshaller[HttpEntity, T]): T
Returns the entity of the response unmarshalled with the given
.Unmarshaller
-
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.
-
def
entityBytes: ByteString
Returns the bytes of the response entity
-
def
entityString: String
Returns the entity of the response interpreted as an UTF-8 encoded string.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from TestRouteResult to StringFormat[TestRouteResult] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
header[T >: Null <: HttpHeader](clazz: Class[T]): T
Returns the first header of the response which is of the given class.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
mediaType: MediaType
Returns the media-type of the the response's content-type
-
def
mediaTypeString: String
Returns a string representation of the media-type of the response's content-type
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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.
-
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.
-
lazy val
response: HttpResponse
Returns a copy of the underlying response with the strictified entity.
-
def
status: StatusCode
Returns the akka.http.javadsl.model.StatusCode of the response.
-
def
statusCode: Int
Returns the numeric status code of the response.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
→[B](y: B): (TestRouteResult, B)
- Implicit
- This member is added by an implicit conversion from TestRouteResult to ArrowAssoc[TestRouteResult] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc