I have a class A with 2 functions: function a() which returns a random number. function b() which calls a() and return the value returned.
In a test I wrote this:
A test = Mockito.mock(A.class)
Mockito.when(test.a()).thenReturn(35)
assertEquals(35,test.a())
assertEquals(35,test.b())
The test fails at the second assert. Does anyone know why?
To be clear - this is not my real code, but a simple code to explain my problem