This class encapsulates an ArgumentCaptor
This trait provides methods to declare expectations on mock calls:
Syntactic sugar on top of the ArgumentCaptor API to avoid using classOf and an explicit call to capture()
This trait allows to specify functions as arguments in mocked methods.
This trait allows to specify functions as arguments in mocked methods.
It uses a pair of (arguments, expected result) to specify what was the passed function:
function2.call((i:Int, d: Double) => (i + d).toString) there was one(function2).call((1, 3.0) -> "4.0")
anyFunctionN will just match any function with n arguments
This class encapsulate mocks which must have their stubbed methods ignored in verification methods
shortcuts to standard Mockito functions
Mockito Matchers for the most common types
This trait provides functionalities to declare stub values on method calls.
This trait provides functionalities to declare stub values on method calls.
Usage:
mockedList.get(0) returns "one" mockedList.get(0) returns ("one", "two") mockedList.get(0) throws new Exception("unexpected") mockedList.get(0) answers ( i => "value " + i.toString ) mockedList.get(any) responds { case i: Int => (i + 1).toString }
It is also possible to chain stubs like this:
mockedList.get(0) returns "one" thenReturns "two" mockedList.get(0) returns "one" thenThrows new Exception("unexpected now")
This trait provides methods to create mocks and spies.
delegate to Mockito static methods with appropriate type inference.
This trait provides methods to declare expectations on mock calls: