Trait/Object

org.mockito

MockitoSugar

Related Docs: object MockitoSugar | package mockito

Permalink

trait MockitoSugar extends MockitoEnhancer with DoSomething with Verifications with Rest

Linear Supertypes
Rest, Verifications, DoSomething, MockitoEnhancer, MockCreator, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MockitoSugar
  2. Rest
  3. Verifications
  4. DoSomething
  5. MockitoEnhancer
  6. MockCreator
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def argumentCaptor[T](implicit arg0: ClassTag[T]): ArgumentCaptor[T]

    Permalink

    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])

    Definition Classes
    Rest
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def atLeast(minNumberOfInvocations: Int): VerificationMode

    Permalink

    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

    Definition Classes
    Verifications
  7. def atLeastOnce: VerificationMode

    Permalink

    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

    Definition Classes
    Verifications
  8. def atMost(maxNumberOfInvocations: Int): VerificationMode

    Permalink

    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

    Definition Classes
    Verifications
  9. def calls(wantedNumberOfInvocations: Int): VerificationMode

    Permalink

    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

    Definition Classes
    Verifications
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def doAnswer[T](f: (InvocationOnMock) ⇒ T): Stubber

    Permalink

    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

    Definition Classes
    DoSomething
  12. def doCallRealMethod: Stubber

    Permalink

    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

    Definition Classes
    DoSomething
  13. def doNothing: Stubber

    Permalink

    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

    Definition Classes
    DoSomething
  14. def doReturn[T](toBeReturned: T, toBeReturnedNext: T*): Stubber

    Permalink

    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`)
    Definition Classes
    DoSomething
  15. def doThrow[T <: Throwable](implicit arg0: ClassTag[T]): Stubber

    Permalink

    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])

    Definition Classes
    DoSomething
  16. def doThrow(toBeThrown: Throwable*): Stubber

    Permalink

    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

    Definition Classes
    DoSomething
  17. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  22. def ignoreStubs(mocks: AnyRef*): Array[AnyRef]

    Permalink

    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

    Definition Classes
    Rest
  23. def inOrder(mocks: AnyRef*): InOrder

    Permalink

    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

    Definition Classes
    Rest
  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. def mock[T <: AnyRef](name: String)(implicit arg0: ClassTag[T], arg1: scala.reflect.api.JavaUniverse.TypeTag[T], defaultAnswer: DefaultAnswer): T

    Permalink

    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...

    Definition Classes
    MockitoEnhancer → MockCreator
  26. def mock[T <: AnyRef](mockSettings: MockSettings)(implicit arg0: ClassTag[T], arg1: scala.reflect.api.JavaUniverse.TypeTag[T]): T

    Permalink

    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...

    Definition Classes
    MockitoEnhancer → MockCreator
  27. def mock[T <: AnyRef](defaultAnswer: DefaultAnswer)(implicit arg0: ClassTag[T], arg1: scala.reflect.api.JavaUniverse.TypeTag[T]): T

    Permalink

    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...

    Definition Classes
    MockitoEnhancer → MockCreator
  28. def mock[T <: AnyRef](implicit arg0: ClassTag[T], arg1: scala.reflect.api.JavaUniverse.TypeTag[T], defaultAnswer: DefaultAnswer): T

    Permalink

    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...

    Definition Classes
    MockitoEnhancer → MockCreator
  29. def mock[T <: AnyRef](defaultAnswer: Answer[_])(implicit arg0: ClassTag[T], arg1: scala.reflect.api.JavaUniverse.TypeTag[T]): T

    Permalink
    Definition Classes
    MockCreator
  30. def mockingDetails(toInspect: AnyRef): MockingDetails

    Permalink

    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

    Definition Classes
    MockitoEnhancer
  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. def never: VerificationMode

    Permalink

    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

    Definition Classes
    Verifications
  33. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  35. def only: VerificationMode

    Permalink

    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

    Definition Classes
    Verifications
  36. def reset(mocks: AnyRef*): Unit

    Permalink

    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

    Definition Classes
    MockitoEnhancer
  37. def spy[T](realObj: T): T

    Permalink

    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

    Definition Classes
    Rest → MockCreator
  38. def spyLambda[T <: AnyRef](realObj: T)(implicit arg0: ClassTag[T]): T

    Permalink

    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

    Definition Classes
    Rest → MockCreator
  39. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  40. def timeout(millis: Int): VerificationWithTimeout

    Permalink

    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

    Definition Classes
    Verifications
  41. def times(wantedNumberOfInvocations: Int): VerificationMode

    Permalink

    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

    Definition Classes
    Verifications
  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. def validateMockitoUsage(): Unit

    Permalink

    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

    Definition Classes
    Rest
  44. def verify[T](mock: T, mode: VerificationMode): T

    Permalink

    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

    Definition Classes
    Rest
  45. def verify[T](mock: T): T

    Permalink

    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

    Definition Classes
    Rest
  46. def verifyNoMoreInteractions(mocks: AnyRef*): Unit

    Permalink

    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

    Definition Classes
    MockitoEnhancer
  47. def verifyZeroInteractions(mocks: AnyRef*): Unit

    Permalink

    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

    Definition Classes
    Rest
  48. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. def when[T](methodCall: T): OngoingStubbing[T]

    Permalink

    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

    Definition Classes
    Rest
  52. def withSettings(implicit defaultAnswer: DefaultAnswer): MockSettings

    Permalink

    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

    Definition Classes
    MockCreator

Inherited from Rest

Inherited from Verifications

Inherited from DoSomething

Inherited from MockitoEnhancer

Inherited from MockCreator

Inherited from AnyRef

Inherited from Any

Ungrouped