ScalaMockスタブのsend(Email)
メソッドが呼び出されたことを確認するにはどうすればよいですか?play.api.libs.mailer.MailerAPI
class SomeTests extends FunSuite with MockFactory {
[...]
val expEmail = play.api.libs.mailer.Email(
"Test",
"admin@test.com",
Seq("user@test.com"),
bodyHtml = Some(s"""<html>
| <body>
| Hello
| </body>
| </html>
| """.stripMargin)
)
val mailerFake = stub[MailerAPI]
// Won't compile
(mailerFake.send _).verify(expEmail)
[...]
}
上記のコードをコンパイルすると、次のエラーが発生します。
Error:(29, -1) Play 2 Compiler:
/Users/arve/Projects/gradlehub/test/ui/pub/RegistrationTest.scala:29: ambiguous reference to overloaded definition,
both method send in trait MailerAPI of type (data: play.libs.mailer.Email)String
and method send in trait MailerAPI of type (data: play.api.libs.mailer.Email)String