我的某些方法将会话作为一个隐式参数。 不会在内部使用它,因为它以代码形式传递到回购的查询位置和查询位置。 当然,我模拟了回购协议,所以我不需要会话,但是在模拟它时却出现错误:
val sessionMock = mock[slick.jdbc.JdbcBackend.Session]
Error:(28, 25) object creation impossible, since:
it has 2 unimplemented members.
/** As seen from <$anon: slick.jdbc.JdbcBackend.Session>, the missing signatures are as follows.
* For convenience, these are usable as stub implementations.
*/
private[package slick] def endInTransaction(f: => Unit): Unit = ???
private[package slick] def startInTransaction: Unit = ???
val sessionMock = mock[slick.jdbc.JdbcBackend.Session]
例如,它可与嘲讽一起使用:
org.mockito.Mockito.mock(classOf[Session])
但是我无法使其与scalamock一起使用。.