I have a scala method call mocked in with mockito.
Let the object be a and method be b and the method b takes parameter of type Map[String, String]. I want to have a Map which meets a certain condition. I dont know all the key value pairs of this Map but I want to ensure that the Map has key value pairs like key1 -> value1 and key2 -> value2
when I use something like this
when(a.b(any[Map[String, String]])) thenReturn something
Here any is a static member in org.mockito. But I cant use this in here as this mock is satisfied for Map with any key and value.
How to achieve a conditional mock in this case ??
I am looking for a utility which is analogous to where method which is in
org.scalamock.matchers.Matchers