scala - Can't find a private method exception, while testing a private method -
i trying write unit test case private method in scala using mockitosugar throwing can't find private method exception. here code.
object activityrepo{ private def addactivity(activity:activity):future[activity]={ //doing db calls } }
unit test:
"activity repo test" must { "add activity" in { // doing mock db calls val addactivity = privatemethod[future[activity]]('addactivity) val result = activityrepo invokeprivate addactivity (activity) // doing assertions } }
where mistake?
Comments
Post a Comment