Given the following code snippet
class Config {
private val conf = ConfigFactory.load()
object Http {
val host = conf.getString("http.host")
val port = conf.getInt("http.port")
}
}
how can host
and port
fields of inner singleton object Http
be mocked?
mockito-scala provides
ReturnsDeepStubs
viaIdiomaticMockito
Without deep stubbing we could do