Variable arguments and Mockito

3 May 2013

Let's say you have a method

def test(t: String, a: Any*) { }

Then you invoke it with:

val args = Seq(1, "b") test("aaa", args:_*)

When you want to verify with Mockito, you have to do this:

there was one(obj).text(eq("aaa"), ArrayBuffer(1, "b"))

Give it a kudos