Created
January 6, 2012 13:48
-
-
Save piotrga/1570689 to your computer and use it in GitHub Desktop.
Mockito fun 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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