I need to mock a method with varargs from a java interface
public interface MyClient {
MyResponse indexPrivileges(IndexPrivilege... parameters);
}
and I am mocking it with
(mockMyClient.indexPrivileges _).expects(*).returns(response)
but get an error
[error] /projects/lib-scala-projects/src/test/scala/com/example/MyManagerTest.scala:67: value expects is not a member of com.example.parameters.IndexPrivilege* => com.example.MyResponse
[error] (mockMyClient.indexPrivileges _).expects(*).returns(response)
[error] ^
Also, I tried with passing a Seq of IndexPrivilege to no avail
(mockMyClient.indexPrivileges _).expects(privileges).returns(response)
Any ideas?