There was a similar question asked about Mockito here
I have a situation where I would like to mock out readValue
in the following line
val animal: Animal = objectMapper.readValue(String(message.body))
I tried
@Test
fun `test you filthy animal`() {
val animal = Animal("bird")
every {
objectMapper.readValue(any<String>())
} returns animal
}
...but I keep getting the following error:
Not enough information to infer type variable T
I have been scratching my head trying to figure it out in Mockk.