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
Delegates to ArgumentMatchers.anyBoolean()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyBoolean()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyByte()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyByte()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyChar()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyChar()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyDouble()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyDouble()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyFloat()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyFloat()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyInt()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyInt()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
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]()
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]()
Delegates to ArgumentMatchers.anyLong()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyLong()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
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]()
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]()
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]()
Delegates to ArgumentMatchers.anyShort()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
Delegates to ArgumentMatchers.anyShort()
, it's only here so we expose all the ArgumentMatchers
on a single place as any[T] would do the job just fine
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
Delegates to ArgumentMatchers.argThat(matcher)
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to ArgumentMatchers.argThat(matcher)
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to ArgumentCaptor.forClass(type: Class[T])
It provides a nicer API as you can, for instance, do argumentCaptor[SomeClass]
instead of ArgumentCaptor.forClass(classOf[SomeClass])
Delegates to ArgumentCaptor.forClass(type: Class[T])
It provides a nicer API as you can, for instance, do argumentCaptor[SomeClass]
instead of ArgumentCaptor.forClass(classOf[SomeClass])
Delegates to Mockito.atLeast()
, it's only here to expose the full Mockito API
Delegates to Mockito.atLeast()
, it's only here to expose the full Mockito API
Delegates to Mockito.atLeastOnce()
, it removes the parenthesis to have a cleaner API
Delegates to Mockito.atLeastOnce()
, it removes the parenthesis to have a cleaner API
Delegates to Mockito.atMost()
, it's only here to expose the full Mockito API
Delegates to Mockito.atMost()
, it's only here to expose the full Mockito API
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 version
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 version
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 version
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 version
Delegates to Mockito.calls()
, it's only here to expose the full Mockito API
Delegates to Mockito.calls()
, it's only here to expose the full Mockito API
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 version
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 version
Delegates to ArgumentMatchers.contains()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to ArgumentMatchers.contains()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to Mockito.doAnswer()
, it's only here to expose the full Mockito API
Delegates to Mockito.doAnswer()
, it's only here to expose the full Mockito API
Delegates to Mockito.doCallRealMethod()
, it removes the parenthesis to have a cleaner API
Delegates to Mockito.doCallRealMethod()
, it removes the parenthesis to have a cleaner API
Delegates to Mockito.doNothing()
, it removes the parenthesis to have a cleaner API
Delegates to Mockito.doNothing()
, it removes the parenthesis to have a cleaner API
Delegates the call to Mockito.doReturn(toBeReturned, toBeReturnedNext)
but fixes the following compiler issue that happens because the overloaded vararg on the Java side
Delegates the call to Mockito.doReturn(toBeReturned, toBeReturnedNext)
but fixes the following compiler issue that happens because the overloaded vararg on the Java side
Error:(33, 25) ambiguous reference to overloaded definition, both method doReturn in class Mockito of type (x$1: Any, x$2: Object*)org.mockito.stubbing.Stubber and method doReturn in class Mockito of type (x$1: Any)org.mockito.stubbing.Stubber match argument types (`Type`)
Delegates to Mockito.doThrow(type: Class[T])
It provides a nicer API as you can, for instance, do doThrow[Throwable] instead of doThrow(classOf[Throwable])
Delegates to Mockito.doThrow(type: Class[T])
It provides a nicer API as you can, for instance, do doThrow[Throwable] instead of doThrow(classOf[Throwable])
Delegates to Mockito.doThrow
, it's only here so we expose all the Mockito API
on a single place
Delegates to Mockito.doThrow
, it's only here so we expose all the Mockito API
on a single place
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 version
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 version
Delegates to ArgumentMatchers.endsWith()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to ArgumentMatchers.endsWith()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to ArgumentMatchers.eq()
, it renames the method to eqTo
to
avoid clashes with the Scala eq
method used for reference equality
Delegates to ArgumentMatchers.eq()
, it renames the method to eqTo
to
avoid clashes with the Scala eq
method used for reference equality
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
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 version
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 version
Delegates to Mockito.ignoreStubs()
, it's only here to expose the full Mockito API
Delegates to Mockito.ignoreStubs()
, it's only here to expose the full Mockito API
Delegates to Mockito.inOrder()
, it's only here to expose the full Mockito API
Delegates to Mockito.inOrder()
, it's only here to expose the full Mockito API
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 version
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 version
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])
Delegates the call to argThat
but using the Scala "primitive", this
provides avoids an unnecessary conversion that would be necessary used
the Java version
Delegates the call to argThat
but using the Scala "primitive", this
provides avoids an unnecessary conversion that would be necessary used
the Java version
Delegates to ArgumentMatchers.matches()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to ArgumentMatchers.matches()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to Mockito.mock(type: Class[T], name: String)
It provides a nicer API as you can, for instance, do mock[MyClass](name)
instead of mock(classOf[MyClass], name)
Delegates to Mockito.mock(type: Class[T], name: String)
It provides a nicer API as you can, for instance, do mock[MyClass](name)
instead of mock(classOf[MyClass], name)
It also pre-stub the mock so the compiler-generated methods that provide the values for the default arguments
are called, ie:
given def iHaveSomeDefaultArguments(noDefault: String, default: String = "default value")
without this fix, if you call it as iHaveSomeDefaultArguments("I'm not gonna pass the second argument")
then you could have not verified it like
verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")
as the value for the second parameter would have been null...
Delegates to Mockito.mock(type: Class[T], mockSettings: MockSettings)
It provides a nicer API as you can, for instance, do mock[MyClass](mockSettings)
instead of mock(classOf[MyClass], mockSettings)
Delegates to Mockito.mock(type: Class[T], mockSettings: MockSettings)
It provides a nicer API as you can, for instance, do mock[MyClass](mockSettings)
instead of mock(classOf[MyClass], mockSettings)
It also pre-stub the mock so the compiler-generated methods that provide the values for the default arguments
are called, ie:
given def iHaveSomeDefaultArguments(noDefault: String, default: String = "default value")
without this fix, if you call it as iHaveSomeDefaultArguments("I'm not gonna pass the second argument")
then you could have not verified it like
verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")
as the value for the second parameter would have been null...
Delegates to Mockito.mock(type: Class[T], defaultAnswer: Answer[_])
It provides a nicer API as you can, for instance, do mock[MyClass](defaultAnswer)
instead of mock(classOf[MyClass], defaultAnswer)
Delegates to Mockito.mock(type: Class[T], defaultAnswer: Answer[_])
It provides a nicer API as you can, for instance, do mock[MyClass](defaultAnswer)
instead of mock(classOf[MyClass], defaultAnswer)
It also pre-stub the mock so the compiler-generated methods that provide the values for the default arguments
are called, ie:
given def iHaveSomeDefaultArguments(noDefault: String, default: String = "default value")
without this fix, if you call it as iHaveSomeDefaultArguments("I'm not gonna pass the second argument")
then you could have not verified it like
verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")
as the value for the second parameter would have been null...
Delegates to Mockito.mock(type: Class[T])
It provides a nicer API as you can, for instance, do mock[MyClass]
instead of mock(classOf[MyClass])
Delegates to Mockito.mock(type: Class[T])
It provides a nicer API as you can, for instance, do mock[MyClass]
instead of mock(classOf[MyClass])
It also pre-stub the mock so the compiler-generated methods that provide the values for the default arguments
are called, ie:
given def iHaveSomeDefaultArguments(noDefault: String, default: String = "default value")
without this fix, if you call it as iHaveSomeDefaultArguments("I'm not gonna pass the second argument")
then you could have not verified it like
verify(aMock).iHaveSomeDefaultArguments("I'm not gonna pass the second argument", "default value")
as the value for the second parameter would have been null...
Delegates to Mockito.mockingDetails()
, it's only here to expose the full Mockito API
Delegates to Mockito.mockingDetails()
, it's only here to expose the full Mockito API
Delegates to Mockito.never()
, it removes the parenthesis to have a cleaner API
Delegates to Mockito.never()
, it removes the parenthesis to have a cleaner API
Delegates to Mockito.only()
, it removes the parenthesis to have a cleaner API
Delegates to Mockito.only()
, it removes the parenthesis to have a cleaner API
Delegates to ArgumentMatchers.refEq()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to ArgumentMatchers.refEq()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to Mockito.reset(T... mocks)
, but restores the default stubs that
deal with default argument values
Delegates to Mockito.reset(T... mocks)
, but restores the default stubs that
deal with default argument values
Delegates to ArgumentMatchers.same()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to ArgumentMatchers.same()
, it's only here so we expose all the ArgumentMatchers
on a single place
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 version
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 version
Delegates to Mockito.spy()
, it's only here to expose the full Mockito API
Delegates to Mockito.spy()
, it's only here to expose the full Mockito API
Creates a "spy" in a way that supports lambdas and anonymous classes as they don't work with the standard spy as they are created as final classes by the compiler
Creates a "spy" in a way that supports lambdas and anonymous classes as they don't work with the standard spy as they are created as final classes by the compiler
Delegates to ArgumentMatchers.startsWith()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to ArgumentMatchers.startsWith()
, it's only here so we expose all the ArgumentMatchers
on a single place
Delegates to Mockito.timeout()
, it's only here to expose the full Mockito API
Delegates to Mockito.timeout()
, it's only here to expose the full Mockito API
Delegates to Mockito.times()
, it's only here to expose the full Mockito API
Delegates to Mockito.times()
, it's only here to expose the full Mockito API
Delegates to Mockito.validateMockitoUsage()
, it's only here to expose the full Mockito API
Delegates to Mockito.validateMockitoUsage()
, it's only here to expose the full Mockito API
Delegates to Mockito.verify()
, it's only here to expose the full Mockito API
Delegates to Mockito.verify()
, it's only here to expose the full Mockito API
Delegates to Mockito.verify()
, it's only here to expose the full Mockito API
Delegates to Mockito.verify()
, it's only here to expose the full Mockito API
Delegates to Mockito.verifyNoMoreInteractions(Object... mocks)
, but ignores the default stubs that
deal with default argument values
Delegates to Mockito.verifyNoMoreInteractions(Object... mocks)
, but ignores the default stubs that
deal with default argument values
Delegates to Mockito.verifyZeroInteractions()
, it's only here to expose the full Mockito API
Delegates to Mockito.verifyZeroInteractions()
, it's only here to expose the full Mockito API
Delegates to Mockito.when()
, it's only here to expose the full Mockito API
Delegates to Mockito.when()
, it's only here to expose the full Mockito API
Delegates to Mockito.withSettings()
, it's only here to expose the full Mockito API
Delegates to Mockito.withSettings()
, it's only here to expose the full Mockito API
The parameterless execute method has been deprecated and will be removed in a future version of ScalaTest. Please invoke execute with empty parens instead: execute().
Delegates to ArgumentMatchers.isNotNull()
, it's only here so we expose all the ArgumentMatchers
on a single place, but marked as @deprecated as you shouldn't be testing for nulls
on Scala
Delegates to ArgumentMatchers.isNotNull()
, it's only here so we expose all the ArgumentMatchers
on a single place, but marked as @deprecated as you shouldn't be testing for nulls
on Scala
Delegates to ArgumentMatchers.isNull()
, it's only here so we expose all the ArgumentMatchers
on a single place, but marked as @deprecated as you shouldn't be testing for nulls
on Scala
Delegates to ArgumentMatchers.isNull()
, it's only here so we expose all the ArgumentMatchers
on a single place, but marked as @deprecated as you shouldn't be testing for nulls
on Scala
The trap method is no longer needed for demos in the REPL, which now abreviates stack traces, and will be removed in a future version of ScalaTest
It automatically wraps each test in a MockitoScalaSession so the implicit verifications are applied
Just mix-in after your favourite suite, i.e.