Month: January 2022

  • Combining fixed arguments with variable arguments in Mockito with Scala

    When you use Mockito to mock an object and add behavior, you sometimes need to combine variable arguments with fixed arguments. When you do that in this way when(client.execute(“myId1”, any[String]) You get as error Invalid use of argument matchers with the explanation that you should use eq as a matcher for the fixed argument. However,…