trait ArgumentMatchersSugar extends AnyMatchers with EqMatchers with ThatMatchers with StringThatMatchers with NullMatchers with FunctionMatchers
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
- Alphabetic
- By Inheritance
- ArgumentMatchersSugar
- FunctionMatchers
- NullMatchers
- StringThatMatchers
- ThatMatchers
- EqMatchers
- AnyMatchers
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
any[T]: T
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 errorDelegates 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 errorError:(71, 46) polymorphic expression cannot be instantiated to expected type; found : [T]()T required: String when you try to something like ArgumentMatchers.any
- Definition Classes
- AnyMatchers
-
def
anyBoolean: Boolean
Delegates to
ArgumentMatchers.anyBoolean()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fineDelegates to
ArgumentMatchers.anyBoolean()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fine- Definition Classes
- AnyMatchers
-
def
anyByte: Byte
Delegates to
ArgumentMatchers.anyByte()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fineDelegates to
ArgumentMatchers.anyByte()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fine- Definition Classes
- AnyMatchers
-
def
anyChar: Char
Delegates to
ArgumentMatchers.anyChar()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fineDelegates to
ArgumentMatchers.anyChar()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fine- Definition Classes
- AnyMatchers
-
def
anyDouble: Double
Delegates to
ArgumentMatchers.anyDouble()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fineDelegates to
ArgumentMatchers.anyDouble()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fine- Definition Classes
- AnyMatchers
-
def
anyFloat: Float
Delegates to
ArgumentMatchers.anyFloat()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fineDelegates to
ArgumentMatchers.anyFloat()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fine- Definition Classes
- AnyMatchers
-
def
anyInt: Int
Delegates to
ArgumentMatchers.anyInt()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fineDelegates to
ArgumentMatchers.anyInt()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fine- Definition Classes
- AnyMatchers
-
def
anyIterable[T]: Iterable[T]
Iterable matcher that use Scala Iterable to avoid compile errors like Error:(40, 60) type mismatch; found : Iterable[String] (in java.util) required: Iterable[?] (in scala.collection.immutable)
Iterable matcher that use Scala Iterable to avoid compile errors like Error:(40, 60) type mismatch; found : Iterable[String] (in java.util) required: Iterable[?] (in scala.collection.immutable)
when trying to do something like ArgumentMatchers.anyIterable[String]()
- Definition Classes
- AnyMatchers
-
def
anyList[T]: List[T]
List matcher that use Scala List to avoid compile errors like Error:(40, 60) type mismatch; found : List[String] (in java.util) required: List[?] (in scala.collection.immutable)
List matcher that use Scala List to avoid compile errors like Error:(40, 60) type mismatch; found : List[String] (in java.util) required: List[?] (in scala.collection.immutable)
when trying to do something like ArgumentMatchers.anyList[String]()
- Definition Classes
- AnyMatchers
-
def
anyLong: Long
Delegates to
ArgumentMatchers.anyLong()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fineDelegates to
ArgumentMatchers.anyLong()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fine- Definition Classes
- AnyMatchers
-
def
anyMap[K, V]: Map[K, V]
Map matcher that use Scala Map to avoid compile errors like Error:(40, 60) type mismatch; found : Map[String, String] (in java.util) required: Map[?] (in scala.collection.immutable)
Map matcher that use Scala Map to avoid compile errors like Error:(40, 60) type mismatch; found : Map[String, String] (in java.util) required: Map[?] (in scala.collection.immutable)
when trying to do something like ArgumentMatchers.anyMap[String, String]()
- Definition Classes
- AnyMatchers
-
def
anySeq[T]: Seq[T]
Seq matcher that use Scala Seq to avoid compile errors like Error:(40, 60) type mismatch; found : List[String] (in java.util) required: Seq[?] (in scala.collection.immutable)
Seq matcher that use Scala Seq to avoid compile errors like Error:(40, 60) type mismatch; found : List[String] (in java.util) required: Seq[?] (in scala.collection.immutable)
when trying to do something like ArgumentMatchers.anyList[String]()
- Definition Classes
- AnyMatchers
-
def
anySet[T]: Set[T]
Set matcher that use Scala Set to avoid compile errors like Error:(40, 60) type mismatch; found : Set[String] (in java.util) required: Set[?] (in scala.collection.immutable)
Set matcher that use Scala Set to avoid compile errors like Error:(40, 60) type mismatch; found : Set[String] (in java.util) required: Set[?] (in scala.collection.immutable)
when trying to do something like ArgumentMatchers.anySet[String]()
- Definition Classes
- AnyMatchers
-
def
anyShort: Short
Delegates to
ArgumentMatchers.anyShort()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fineDelegates to
ArgumentMatchers.anyShort()
, it's only here so we expose all theArgumentMatchers
on a single place as any[T] would do the job just fine- Definition Classes
- AnyMatchers
-
def
anyVal[T](implicit valueClassMatchers: ValueClassMatchers[T]): T
Wraps the standard 'any' matcher on the value class provided, this one requires the type to be explicit
Wraps the standard 'any' matcher on the value class provided, this one requires the type to be explicit
- Definition Classes
- AnyMatchers
-
def
argThat[T](matcher: ArgumentMatcher[T]): T
Delegates to
ArgumentMatchers.argThat(matcher)
, it's only here so we expose all theArgumentMatchers
on a single placeDelegates to
ArgumentMatchers.argThat(matcher)
, it's only here so we expose all theArgumentMatchers
on a single place- Definition Classes
- ThatMatchers
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
booleanThat(matcher: ArgumentMatcher[Boolean]): Boolean
Delegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java versionDelegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java version- Definition Classes
- ThatMatchers
-
def
byteThat(matcher: ArgumentMatcher[Byte]): Byte
Delegates the call to
argThat
but using the Scala "primitives", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java versionDelegates the call to
argThat
but using the Scala "primitives", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java version- Definition Classes
- ThatMatchers
-
def
charThat(matcher: ArgumentMatcher[Char]): Char
Delegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java versionDelegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java version- Definition Classes
- ThatMatchers
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
contains(substring: String): String
Delegates to
ArgumentMatchers.contains()
, it's only here so we expose all theArgumentMatchers
on a single placeDelegates to
ArgumentMatchers.contains()
, it's only here so we expose all theArgumentMatchers
on a single place- Definition Classes
- StringThatMatchers
-
def
doubleThat(matcher: ArgumentMatcher[Double]): Double
Delegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java versionDelegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java version- Definition Classes
- ThatMatchers
-
def
endsWith(suffix: String): String
Delegates to
ArgumentMatchers.endsWith()
, it's only here so we expose all theArgumentMatchers
on a single placeDelegates to
ArgumentMatchers.endsWith()
, it's only here so we expose all theArgumentMatchers
on a single place- Definition Classes
- StringThatMatchers
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
eqTo[T](value: T): T
Delegates to
ArgumentMatchers.eq()
, it renames the method toeqTo
to avoid clashes with the Scalaeq
method used for reference equalityDelegates to
ArgumentMatchers.eq()
, it renames the method toeqTo
to avoid clashes with the Scalaeq
method used for reference equality- Definition Classes
- EqMatchers
-
def
eqToVal[T](value: Any)(implicit valueClassMatchers: ValueClassMatchers[T]): T
Wraps the standard 'ArgumentMatchers.eq()' matcher on the value class provided, this one requires the type to be explicit
Wraps the standard 'ArgumentMatchers.eq()' matcher on the value class provided, this one requires the type to be explicit
- Definition Classes
- EqMatchers
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
floatThat(matcher: ArgumentMatcher[Float]): Float
Delegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java versionDelegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java version- Definition Classes
- ThatMatchers
-
def
function0[T](value: T): () ⇒ T
- Definition Classes
- FunctionMatchers
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
intThat(matcher: ArgumentMatcher[Int]): Int
Delegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java versionDelegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java version- Definition Classes
- ThatMatchers
-
def
isA[T](implicit classTag: ClassTag[T]): T
Delegates to
ArgumentMatchers.isA(type: Class[T])
It provides a nicer API as you can, for instance, do isA[String] instead of isA(classOf[String])Delegates to
ArgumentMatchers.isA(type: Class[T])
It provides a nicer API as you can, for instance, do isA[String] instead of isA(classOf[String])- Definition Classes
- EqMatchers
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
longThat(matcher: ArgumentMatcher[Long]): Long
Delegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary conversion that would be necessary used the Java versionDelegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary conversion that would be necessary used the Java version- Definition Classes
- ThatMatchers
-
def
matches(regex: String): String
Delegates to
ArgumentMatchers.matches()
, it's only here so we expose all theArgumentMatchers
on a single placeDelegates to
ArgumentMatchers.matches()
, it's only here so we expose all theArgumentMatchers
on a single place- Definition Classes
- StringThatMatchers
-
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
refEq[T](value: T, excludeFields: String*): T
Delegates to
ArgumentMatchers.refEq()
, it's only here so we expose all theArgumentMatchers
on a single placeDelegates to
ArgumentMatchers.refEq()
, it's only here so we expose all theArgumentMatchers
on a single place- Definition Classes
- EqMatchers
-
def
same[T](value: T): T
Delegates to
ArgumentMatchers.same()
, it's only here so we expose all theArgumentMatchers
on a single placeDelegates to
ArgumentMatchers.same()
, it's only here so we expose all theArgumentMatchers
on a single place- Definition Classes
- EqMatchers
-
def
shortThat(matcher: ArgumentMatcher[Short]): Short
Delegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java versionDelegates the call to
argThat
but using the Scala "primitive", this provides avoids an unnecessary implicit conversion that would be necessary if we used the Java version- Definition Classes
- ThatMatchers
-
def
startsWith(prefix: String): String
Delegates to
ArgumentMatchers.startsWith()
, it's only here so we expose all theArgumentMatchers
on a single placeDelegates to
ArgumentMatchers.startsWith()
, it's only here so we expose all theArgumentMatchers
on a single place- Definition Classes
- StringThatMatchers
-
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
- @native() @throws( ... )
Deprecated Value Members
-
def
isNotNull[T]: T
Delegates to
ArgumentMatchers.isNotNull()
, it's only here so we expose all theArgumentMatchers
on a single place, but marked as @deprecated as you shouldn't be testing for nulls on ScalaDelegates to
ArgumentMatchers.isNotNull()
, it's only here so we expose all theArgumentMatchers
on a single place, but marked as @deprecated as you shouldn't be testing for nulls on Scala- Definition Classes
- NullMatchers
- Annotations
- @deprecated
- Deprecated
-
def
isNull[T]: T
Delegates to
ArgumentMatchers.isNull()
, it's only here so we expose all theArgumentMatchers
on a single place, but marked as @deprecated as you shouldn't be testing for nulls on ScalaDelegates to
ArgumentMatchers.isNull()
, it's only here so we expose all theArgumentMatchers
on a single place, but marked as @deprecated as you shouldn't be testing for nulls on Scala- Definition Classes
- NullMatchers
- Annotations
- @deprecated
- Deprecated