Trait/Object

org.mockito

ArgumentMatchersSugar

Related Docs: object ArgumentMatchersSugar | package mockito

Permalink

trait ArgumentMatchersSugar extends AnyMatchers with EqMatchers with EqMatchers_211 with ThatMatchers with StringThatMatchers with NullMatchers with FunctionMatchers with NumericMatchers with MacroBasedMatchers

Trait that provides some syntax sugar and type mapping.

It mostly forwards the calls to org.mockito.ArgumentMatchers, but with a few improvements to make it more scala-like It also renames the "eq" matcher to "eqTo" as in Scala "eq" is a keyword used to do object identity equality

Linear Supertypes
MacroBasedMatchers, NumericMatchers, Tolerance, FunctionMatchers, NullMatchers, StringThatMatchers, ThatMatchers, EqMatchers_211, EqMatchers, AnyMatchers, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ArgumentMatchersSugar
  2. MacroBasedMatchers
  3. NumericMatchers
  4. Tolerance
  5. FunctionMatchers
  6. NullMatchers
  7. StringThatMatchers
  8. ThatMatchers
  9. EqMatchers_211
  10. EqMatchers
  11. AnyMatchers
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class PlusOrMinusWrapper[T] extends AnyRef

    Permalink
    Definition Classes
    Tolerance

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def *[T](implicit arg0: AnyMatcher[T]): T

    Permalink

    Alias for org.mockito.matchers.MacroBasedMatchers.any

  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. def any[T](implicit arg0: AnyMatcher[T]): T

    Permalink

    Delegates to ArgumentMatchers.any(), it's main purpose is to remove the () out of the method call, if you try to do that directly on the test you get this error

    Delegates to ArgumentMatchers.any(), it's main purpose is to remove the () out of the method call, if you try to do that directly on the test you get this error

    Error:(71, 46) polymorphic expression cannot be instantiated to expected type; found : [T]()T required: String when you try to something like ArgumentMatchers.any

    It also fixes the NullPointerException when used on an value class argument (IMPORTANT: YOU MUST PROVIDE THE TYPE FOR VALUE CLASSES)

    Definition Classes
    MacroBasedMatchers
  6. def anyBoolean: Boolean

    Permalink
    Definition Classes
    AnyMatchers
  7. def anyByte: Byte

    Permalink
    Definition Classes
    AnyMatchers
  8. def anyChar: Char

    Permalink
    Definition Classes
    AnyMatchers
  9. def anyDouble: Double

    Permalink
    Definition Classes
    AnyMatchers
  10. def anyFloat: Float

    Permalink
    Definition Classes
    AnyMatchers
  11. def anyInt: Int

    Permalink
    Definition Classes
    AnyMatchers
  12. def anyIterable[T]: Iterable[T]

    Permalink
    Definition Classes
    AnyMatchers
  13. def anyList[T]: List[T]

    Permalink
    Definition Classes
    AnyMatchers
  14. def anyLong: Long

    Permalink
    Definition Classes
    AnyMatchers
  15. def anyMap[K, V]: Map[K, V]

    Permalink
    Definition Classes
    AnyMatchers
  16. def anySeq[T]: Seq[T]

    Permalink
    Definition Classes
    AnyMatchers
  17. def anySet[T]: Set[T]

    Permalink
    Definition Classes
    AnyMatchers
  18. def anyShort: Short

    Permalink
    Definition Classes
    AnyMatchers
  19. def argMatching[T](pf: PartialFunction[Any, Unit]): T

    Permalink
    Definition Classes
    ThatMatchers
  20. def argThat[T](matcher: ArgumentMatcher[T]): T

    Permalink
    Definition Classes
    ThatMatchers
  21. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  22. def booleanThat(matcher: ArgumentMatcher[Boolean]): Boolean

    Permalink
    Definition Classes
    ThatMatchers
  23. def byteThat(matcher: ArgumentMatcher[Byte]): Byte

    Permalink
    Definition Classes
    ThatMatchers
  24. def charThat(matcher: ArgumentMatcher[Char]): Char

    Permalink
    Definition Classes
    ThatMatchers
  25. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def contains(substring: String): String

    Permalink
    Definition Classes
    StringThatMatchers
  27. implicit def convertNumericToPlusOrMinusWrapper[T](pivot: T)(implicit arg0: Numeric[T]): PlusOrMinusWrapper[T]

    Permalink
    Definition Classes
    Tolerance
  28. def doubleThat(matcher: ArgumentMatcher[Double]): Double

    Permalink
    Definition Classes
    ThatMatchers
  29. def endsWith(suffix: String): String

    Permalink
    Definition Classes
    StringThatMatchers
  30. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  31. macro def eqTo[T](value: T)(implicit eq: Equality[T]): T

    Permalink

    Creates a matcher that delegates on {{org.scalactic.Equality}} so you can always customise how the values are compared Also works with value classes

    Creates a matcher that delegates on {{org.scalactic.Equality}} so you can always customise how the values are compared Also works with value classes

    Definition Classes
    EqMatchers_211
  32. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  33. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  34. def floatThat(matcher: ArgumentMatcher[Float]): Float

    Permalink
    Definition Classes
    ThatMatchers
  35. def function0[T](value: T): () ⇒ T

    Permalink
    Definition Classes
    FunctionMatchers
  36. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  37. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  38. def intThat(matcher: ArgumentMatcher[Int]): Int

    Permalink
    Definition Classes
    ThatMatchers
  39. def isA[T](implicit arg0: ClassTag[T]): T

    Permalink
    Definition Classes
    EqMatchers
  40. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  41. def longThat(matcher: ArgumentMatcher[Long]): Long

    Permalink
    Definition Classes
    ThatMatchers
  42. def matches(regex: String): String

    Permalink
    Definition Classes
    StringThatMatchers
  43. val n: N

    Permalink
    Definition Classes
    NumericMatchers
  44. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  45. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  46. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  47. def refEq[T](value: T, excludeFields: String*): T

    Permalink
    Definition Classes
    EqMatchers
  48. def same[T](value: T): T

    Permalink
    Definition Classes
    EqMatchers
  49. def shortThat(matcher: ArgumentMatcher[Short]): Short

    Permalink
    Definition Classes
    ThatMatchers
  50. def startsWith(prefix: String): String

    Permalink
    Definition Classes
    StringThatMatchers
  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  52. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  53. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def anyVal[T](implicit arg0: AnyMatcher[T]): T

    Permalink

    It was intended to be used instead of any when the argument is a value class, but any now supports value classes so it is not needed anymore

    It was intended to be used instead of any when the argument is a value class, but any now supports value classes so it is not needed anymore

    Definition Classes
    MacroBasedMatchers
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.2) Use 'any[T]' or '*[T]' instead

  2. macro def eqToVal[T](value: T): T

    Permalink

    It was intended to be used instead of eqTo when the argument is a value class, but eqTo now supports value classes so it is not needed anymore

    It was intended to be used instead of eqTo when the argument is a value class, but eqTo now supports value classes so it is not needed anymore

    Definition Classes
    EqMatchers_211
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.2) Use 'eqTo' instead

  3. def isNotNull[T]: T

    Permalink
    Definition Classes
    NullMatchers
    Annotations
    @deprecated
    Deprecated

    (Since version 0.0.0) Using nulls in Scala? you naughty, naughty developer...

  4. def isNull[T]: T

    Permalink
    Definition Classes
    NullMatchers
    Annotations
    @deprecated
    Deprecated

    (Since version 0.0.0) Using nulls in Scala? you naughty, naughty developer...

Inherited from MacroBasedMatchers

Inherited from NumericMatchers

Inherited from Tolerance

Inherited from FunctionMatchers

Inherited from NullMatchers

Inherited from StringThatMatchers

Inherited from ThatMatchers

Inherited from EqMatchers_211

Inherited from EqMatchers

Inherited from AnyMatchers

Inherited from AnyRef

Inherited from Any

Ungrouped