Scala Unit Testing - Mocking an implicitly wrapped function -


i have question concerning unit tests i'm trying achieve using mockito in scala. i've looked scalamock sounds feature not provided well. suppose maybe i'm looking narrow way solution , there might different perspective or approach im doing opinions welcomed.

basically, want mock function available object using implicit conversion, , don't have control change how done. since i'm user library. concrete example similar following scenario

rdd: rdd[t] = //existing rdd sqlcontext: sqlcontext = //existing sqlcontext import sqlcontext.implicits._ rdd.todf()  /*todf() doesn't exist @ rdd implicitly added when importing sqlcontext.implicits._*/ 

now in testing, i'm mocking rdd , sqlcontext , want mock todf() function. can't mock function todf() since doesn't exist on rdd level. if simple trick, importing mocked sqlcontext.implicit._ error function not publicaly available object can't mocked. tried mock code implicitly executed until todf() stuck final/pivate[in accessible] classes can't mock. suggestions more welcomed. in advance :)


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -