ScalaTest 1.1
|
|
org/scalatest/mock/MockitoSugar.scala
]
trait
MockitoSugar
extends
AnyRefUsing the Mockito API directly, you create a mock with:
val mockCollaborator = mock(classOf[Collaborator])
Using this trait, you can shorten that to:
val mockCollaborator = mock[Collaborator]
Method Summary | |
def
|
mock
[T <: AnyRef](implicit manifest : scala.reflect.Manifest[T]) : T
Invokes the
mock method on the Mockito companion object (i.e., the
static mock method in Java class org.mockito.Mockitok ). |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
def
mock[T <: AnyRef](implicit
manifest : scala.reflect.Manifest[T]) : T
mock
method on the Mockito
companion object (i.e., the
static mock
method in Java class org.mockito.Mockitok
).
Using the Mockito API directly, you create a mock with:
val mockCollaborator = mock(classOf[Collaborator])
Using this method, you can shorten that to:
val mockCollaborator = mock[Collaborator]
ScalaTest 1.1
|
|