Route

mockws.Route
case class Route(route: Routes) extends Routes

traces whether a route was called and how many times. Usage:

val route1 = Route {
  case (GET, "/route1") => Action { Ok("") }
}
val route2 = Route {
  case (GET, "/route2") => Action { Ok("") }
}

val ws = MockWS(route1 orElse route2)

await(ws.url("/route1").get())

route1.called == true
route2.called == false

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait PartialFunction[(String, String), EssentialAction]
trait ((String, String)) => EssentialAction
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def apply(r: (String, String)): EssentialAction

Attributes

Definition Classes
Function1
def called: Boolean

Attributes

Returns

true if the route was called at least one time

override def isDefinedAt(x: (String, String)): Boolean

Attributes

Definition Classes
PartialFunction
def timeCalled: Int

Attributes

Returns

the number of times the route was called

Inherited methods

def andThen[C](k: PartialFunction[EssentialAction, C]): PartialFunction[(String, String), C]

Attributes

Inherited from:
PartialFunction
override def andThen[C](k: EssentialAction => C): PartialFunction[(String, String), C]

Attributes

Definition Classes
PartialFunction -> Function1
Inherited from:
PartialFunction
def applyOrElse[A1 <: (String, String), B1 >: EssentialAction](x: A1, default: A1 => B1): B1

Attributes

Inherited from:
PartialFunction
def compose[R](k: PartialFunction[R, (String, String)]): PartialFunction[R, EssentialAction]

Attributes

Inherited from:
PartialFunction
def compose[A](g: A => (String, String)): A => EssentialAction

Attributes

Inherited from:
Function1
def elementWise: ElementWiseExtractor[(String, String), EssentialAction]

Attributes

Inherited from:
PartialFunction
def lift: (String, String) => Option[EssentialAction]

Attributes

Inherited from:
PartialFunction
def orElse[A1 <: (String, String), B1 >: EssentialAction](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]

Attributes

Inherited from:
PartialFunction
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def runWith[U](action: EssentialAction => U): (String, String) => Boolean

Attributes

Inherited from:
PartialFunction
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1
def unapply(a: (String, String)): Option[EssentialAction]

Attributes

Inherited from:
PartialFunction