如何模拟内部单例对象的字段?

时间:2018-02-03 01:12:45

标签: scala mockito inner-classes scalatest

给出以下代码片段

class Config {
  private val conf = ConfigFactory.load()

  object Http {
    val host = conf.getString("http.host")
    val port = conf.getInt("http.port")
  }
}

如何嘲笑内部单例对象host的{​​{1}}和port字段?

1 个答案:

答案 0 :(得分:1)

Http