I\'m trying to have one of my mocked objects throw a checked Exception when a particular method is called. I\'m trying the following.
@Test(expectedException
There is the solution with Kotlin :
given(myObject.myCall()).willAnswer { throw IOException("Ooops") }
Where given comes from
import org.mockito.BDDMockito.given