我正在尝试存根抽象java.nio.channels.ServerSocketChannel
类但得到了
Error:(15, 18) object creation impossible, since:
it has 2 unimplemented members.
/** As seen from <$anon: java.nio.channels.ServerSocketChannel>, the missing signatures are as follows.
* For convenience, these are usable as stub implementations.
*/
protected[package spi] def implCloseSelectableChannel(): Unit = ???
protected[package spi] def implConfigureBlocking(x$1: Boolean): Unit = ???
socket = stub[ServerSocketChannel]
当然我可以在测试子类中覆盖这些方法,但也许有更优雅的解决方案?