1
ScalaMock 스텁이 인 send(Email)
메서드가 호출되었는지 어떻게 확인할 수 있습니까?MailerAPI.send의 ScalaMocks 스텁이 호출되었는지 확인하는 방법은 무엇입니까?
class SomeTests extends FunSuite with MockFactory {
[...]
val expEmail = play.api.libs.mailer.Email(
"Test",
"[email protected]",
Seq("[email protected]"),
bodyHtml = Some(s"""<html>
| <body>
| Hello
| </body>
| </html>
| """.stripMargin)
)
val mailerFake = stub[MailerAPI]
// Won't compile
(mailerFake.send _).verify(expEmail)
[...]
}
위의 코드를 컴파일 할 때, 나는 다음과 같은 오류 얻을 : send
이후
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