How to mock a function within Scala object using Mockito?

前端 未结 3 414
梦如初夏
梦如初夏 2020-12-19 02:42

I am really new to Scala. I tried to mock a simple Scala function using Mockito, but I get the following error. I have checked the internet but I was unable to find out the

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-19 03:05

    You can create a Scala Companion Object:

    1. Write test cases for you class.
    2. Let that object do the external world interaction.

提交回复
热议问题