I have the following method call in my Kotlin class:
myService.trigger(id, processVariables, transientVariables)
... where "id" is a String, "processVariables" is a Java Map<String, Object> and "transientVariables" is a Kotlin MutableMap<String, Any>.
How to I specify the answer to return in a unit test for this circumstance? I have tried the following:
every { myService?.trigger(MY_ID, any(), any()) } returns unit
... but I get an error when the unit test runs:
io.mockk.MockKException: no answer found for: MyService(#2).trigger(MY_ID, {}, {key=value})
Thanks in advance for any assistance.
A workaround that can be compiled and results in a successful test run is to populate the Map with values: