this implicit helps with defining optional values for mockito settings
ignore stubbed methods when verifying that a mock has no more interactions
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:
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
This trait provides methods to create mocks and spies.