0

I have one specific requirement of Unit testing a function in which it take a kotlin class object that comes from gradle library.

I want to create its Fake/mock Test double. but problem is it's kotlin class, so by default class is final, so can't mock or can't use inheritance to create child class. This class doesn't implementation any interface.

e.g

class ABC(val xyz: KotlinClass) 

here kotlinClass is coming from library. So no code modification possible. 

How to mock or fake behaviour of xyz object here.

Amit kumar
  • 101
  • 13

0 Answers0