provide stub chain methods.
provide stub chain methods.
class supporting 'was' and 'were' methods to forward mockito calls to the CallsMatcher matcher
This class is an implementation of the Answer interface allowing to pass functions as an answer.
class providing a apply method to be able to declare a number of calls: 3.
This class provide stub methods like returns, throws and answers.
class defining a then method to declare that calls must be made in a specific order.
an object allowing the chaining of returned values on doNothing calls.
allows to use a hamcrest matchers to match parameters.
allows to use a hamcrest matchers to match parameters.
an object allowing the chaining of stub values.
this implicit helps with defining optional values for mockito settings
this implicit helps with defining optional values for mockito settings
allows to use a specs matcher to match parameters by encapsulating it as a Hamcrest matcher.
allows to use a specs matcher to match parameters by encapsulating it as a Hamcrest matcher.
at least n calls made to the mock
at least n calls made to the mock
at least 1 call made to the mock
at least 1 call made to the mock
at least 3 calls made to the mock
at least 3 calls made to the mock
at least 2 calls made to the mock
at least 2 calls made to the mock
at most n calls made to the mock
at most n calls made to the mock
at most 1 call made to the mock
at most 1 call made to the mock
at most 3 calls made to the mock
at most 3 calls made to the mock
at most 2 calls made to the mock
at most 2 calls made to the mock
A value can be tested against another with the === operator.
A value can be tested against another with the === operator. It is equivalent to writting a must_== b
capture an argument of type T
capture an argument of type T
this conversion allows to capture the parameter is a mocked call
this conversion allows to capture the parameter is a mocked call
this method can be overriden to throw exceptions when checking the match result
this method can be overriden to throw exceptions when checking the match result
this method can be overriden to throw exceptions when checking the result
this method can be overriden to throw exceptions when checking the result
an Expectable with a description function
an Expectable with a description function
an Expectable with a description
an Expectable
describe a value with the aka method
describe a value with the aka method
delegate to MockitoMocker doAnswer with a MockAnswer object using the function f.
delegate to MockitoMocker doAnswer with a MockAnswer object using the function f.
alias for 'there was'
alias for 'there was'
This implicit definition allows to declare a number of times
3.times
This implicit definition allows to declare a number of times
3.times
create a mock object with some specific settings: val m = mock[java.
create a mock object with some specific settings: val m = mock[java.util.List[String]](settings)
create a mock object: val m = mock[java.
create a mock object: val m = mock[java.util.List[String]]
create a mock object with a name: val m = mockAs[java.
create a mock object with a name: val m = mockAs[java.util.List[String]]("name")
implicit allowing to define the mock settings with a nice syntax:
implicit allowing to define the mock settings with a nice syntax:
no call made to the mock
no call made to the mock
no more calls made to the mock
no more calls made to the mock
one call only made to the mock
one call only made to the mock
implicit definition to be able to declare a number of calls 3.
implicit definition to be able to declare a number of calls 3.times(m).clear()
create a mock object with smart return values: val m = smartMock[java.
create a mock object with smart return values: val m = smartMock[java.util.List[String]]
This is the equivalent of Mockito.mock(List.class, SMART_NULLVALUES) but testing shows that it is not working well with Scala.
create a spy on an object.
create a spy on an object.
A spy is a real object but can still have some of its methods stubbed. However the syntax for stubbing a spy is a bit different than
with a mock:
val s = spy(new LinkedList[String])
doReturn("one").when(s).get(0) // instead of s.get(0) returns "one" which would throw an exception
an object supporting the stub methods.
create an object supporting 'was' and 'were' methods
create an object supporting 'was' and 'were' methods
three calls only made to the mock
three calls only made to the mock
implicit def supporting calls in order
implicit def supporting calls in order
two calls only made to the mock
two calls only made to the mock
This trait can be used to access Mockito functionalities.