Is it possible to Mock a single method of a Java class?
For example:
class A { long method1(); String method2(); int method3(); } // in
Use the spy() method from Mockito, and mock your method like this:
import static org.mockito.Mockito.*; ... A a = spy(new A()); when(a.method1()).thenReturn(10L);