Skip to content

Instantly share code, notes, and snippets.

@piotrga
Created January 6, 2012 13:48
Show Gist options
  • Save piotrga/1570689 to your computer and use it in GitHub Desktop.
Save piotrga/1570689 to your computer and use it in GitHub Desktop.
Mockito fun 1
import org.mockito.Mockito._
import org.scalatest.mock.MockitoSugar
import org.mockito.Matchers
object MockitoFun1 extends App with MockitoSugar{
trait X{
def x
}
trait Y{
def y : Int
}
val xy = mock[X with Y]
when(xy.y) thenReturn 8
}
Exception in thread "main" java.lang.ClassCastException: akka.camel.MockitoFun1$X$$EnhancerByMockitoWithCGLIB$$e1d7d41 cannot be cast to akka.camel.MockitoFun1$Y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment