JsonMatchers

object JsonMatchers extends JsonMatchers
Companion:
class
trait Expectations
trait ExpectationsDescription
trait TypedEqual
trait ExpectationsCreation
trait ResultChecks
trait MatchResultStackTrace
class Object
trait Matchable
class Any

Type members

Inherited classlikes

case object Deep extends JsonQueryType
Inherited from:
JsonSelectors
case object First extends JsonQueryType
Inherited from:
JsonSelectors
case class JsonDoubleSelector(d: Double) extends JsonValueSelector
Inherited from:
JsonSelectors
case class JsonEqualValueSelector(v: Any) extends JsonValueSelector
Inherited from:
JsonSelectors
case class JsonFinalMatcher(queries: Seq[JsonQuery], check: Matcher[JsonType], negated: Boolean) extends JsonMatcher

This matcher can not be chained anymore with selections

This matcher can not be chained anymore with selections

Inherited from:
JsonMatchers
case class JsonIndexSelector(n: Int) extends JsonSelector
Inherited from:
JsonSelectors
case class JsonIntSelector(n: Int) extends JsonValueSelector
Inherited from:
JsonSelectors
abstract class JsonMatcher extends Matcher[String]
Inherited from:
JsonMatchers
Inherited from:
JsonMatchers
case class JsonMatcherSelector(m: Matcher[String]) extends JsonValueSelector
Inherited from:
JsonSelectors
Inherited from:
JsonSelectors
case class JsonQuery(query: JsonQueryType, selector: JsonSelector)
Inherited from:
JsonSelectors
sealed trait JsonQueryType
Inherited from:
JsonSelectors
case class JsonRegexSelector(r: Regex) extends JsonValueSelector
Inherited from:
JsonSelectors
sealed trait JsonSelector
Inherited from:
JsonSelectors
case class JsonSelectorMatcher(queries: Seq[JsonQuery], negated: Boolean) extends JsonMatcher

This matcher can be chained to select further elements in the Json object

This matcher can be chained to select further elements in the Json object

Inherited from:
JsonMatchers
case class JsonValueOrKeySelector(selector: JsonSelector) extends JsonSelector
Inherited from:
JsonSelectors
Inherited from:
JsonSelectors
object given_ToJsonSelector_Matcher extends ToJsonSelector[Matcher[String]]

Value members

Inherited methods

Inherited from:
JsonMatchers
Inherited from:
JsonMatchers
def /#(n: Int): JsonSelectorMatcher
Inherited from:
JsonMatchers
def beJsonNull: Matcher[JsonType]
Inherited from:
JsonMatchers
protected def checkResultFailure(r: => Result): Result

this method can be overridden to throw exceptions when checking a result

this method can be overridden to throw exceptions when checking a result

Inherited from:
ResultChecks
def createExpectable[T](t: => T, alias: String => String): Expectable[T]
Returns:

an Expectable with a description function

Inherited from:
ExpectationsCreation
def createExpectable[T](t: => T, alias: => String): Expectable[T]
Returns:

an Expectable with a description

Inherited from:
ExpectationsCreation
def createExpectable[T](t: => T): Expectable[T]
Returns:

an Expectable

Inherited from:
ExpectationsCreation
def createExpectable[T](t: => T, alias: Option[String => String]): Expectable[T]
Returns:

an Expectable with a description function

Inherited from:
ExpectationsCreation
def createExpectableWithShowAs[T](t: => T, showAs: => String): Expectable[T]
Returns:

an Expectable with a function to show the element T

Inherited from:
ExpectationsCreation
def have(m: Matcher[JsonType]): JsonMatcher
Inherited from:
JsonMatchers
protected def mapResult(r: Result): Result

this method can be overridden to intercept a Result and modify it. It is used for example to set a stacktrace providing the location of a failure

this method can be overridden to intercept a Result and modify it. It is used for example to set a stacktrace providing the location of a failure

Inherited from:
ResultChecks
protected def sandboxResult(r: => Result): Result
Returns:

the result without any side-effects

Inherited from:
ResultChecks
protected def setStacktrace(m: Result): Result

this method can be overridden to avoid filling-in a stacktrace indicating the location of the result

this method can be overridden to avoid filling-in a stacktrace indicating the location of the result

Inherited from:
MatchResultStackTrace
def theBlock(t: => Nothing): Expectable[Nothing]
Inherited from:
ExpectationsCreation
def theValue[T](t: => T): Expectable[T]
Inherited from:
ExpectationsCreation

Inherited fields

val anyValue: Matcher[Any]
Inherited from:
JsonSelectors

Givens

Inherited givens

Inherited from:
JsonMatchersImplicits (hidden)
Inherited from:
JsonMatchersImplicits (hidden)
Inherited from:
JsonMatchersImplicits (hidden)
given given_Conversion_K_V_JsonPairSelector[K, V](using evidence$1: ToJsonSelector[K], evidence$2: ToJsonSelector[V]): given_Conversion_K_V_JsonPairSelector[K, V]
Inherited from:
JsonMatchersImplicits (hidden)
given given_Conversion_M_JsonSelector[M <: Matcher[String]]: given_Conversion_M_JsonSelector[M]

datatype to specify how json values must be checked

datatype to specify how json values must be checked

Inherited from:
JsonMatchersImplicits (hidden)
Inherited from:
JsonMatchersImplicits (hidden)
Inherited from:
JsonMatchersImplicits (hidden)
Inherited from:
JsonMatchersLowImplicits (hidden)
Inherited from:
JsonMatchersLowImplicits (hidden)
Inherited from:
JsonMatchersLowImplicits (hidden)
given given_ToJsonSelector_M[M <: Matcher[String]]: given_ToJsonSelector_M[M]
Inherited from:
JsonMatchersImplicits (hidden)
Inherited from:
JsonMatchersImplicits (hidden)
Inherited from:
JsonMatchersImplicits (hidden)
Inherited from:
JsonMatchersLowImplicits (hidden)

Extensions

Inherited extensions

extension [T](description: String)
def <==>(using not: NotGiven[NoExpectationsDescription])(result: => T)(using evidence$2: AsResult[T]): Result
Inherited from:
ExpectationsDescription
def ==>(using not: NotGiven[NoExpectationsDescription])(result: => T)(using evidence$1: AsResult[T]): Result
Inherited from:
ExpectationsDescription
extension [T](t: => T)
def !==(using not: NotGiven[NoTypedEqual])(other: => T)(using evidence$2: Diffable[T]): Result

! equality matcher on Expectables

! equality matcher on Expectables

Inherited from:
TypedEqual
def ===(using not: NotGiven[NoTypedEqual])(other: => T)(using evidence$1: Diffable[T]): Result

equality matcher on Expectables

equality matcher on Expectables

Inherited from:
TypedEqual
extension [T](value: => T)
infix def showAs(using not: NotGiven[NoValueDescription], show: T => String): Expectable[T]
Returns:

an expectable with a function to show the element T

Inherited from:
ExpectationsDescription
extension [T](value: => T)
infix def aka(using not: NotGiven[NoValueDescription])(alias: => String): Expectable[T]
Returns:

an expectable with an alias description

Inherited from:
ExpectationsDescription
infix def aka(using not: NotGiven[NoValueDescription]): Expectable[T]
Returns:

an expectable with its toString method as an alias description this is useful to preserve the original value when the matcher using it is adapting the value

Inherited from:
ExpectationsDescription
infix def as(using not: NotGiven[NoValueDescription])(alias: String => String): Expectable[T]
Returns:

an expectable with an alias description, after the value string

Inherited from:
ExpectationsDescription
infix def post(using not: NotGiven[NoValueDescription])(alias: => String): Expectable[T]
Returns:

an expectable with an alias description, after the value string

Inherited from:
ExpectationsDescription
@targetName("showAsFunction")
infix def showAs(using not: NotGiven[NoValueDescription])(show: T => String): Expectable[T]
Returns:

an expectable with a function to show the element T

Inherited from:
ExpectationsDescription