I want to test my code which has a few tail recursive functions.
I couldn't mock the tail recursive functions because they need to declared either Final
or Private
.
Most mocking frameworks don't support mocking such methods, the ones that support isn't working as expected.
Is this possible at all? Can some one provide me their ideas to mock tail recursive functions?
I tried mocking using Mockito
Framework version 3.0.0
. My Test suite is extended with the Mockito-Sugar
trait.
Though mockito documentation suggests that final methods can be mocked, It results in failure for me.
I tried using scala-mock
. I faced different problems and didn't work out.