Guest User

Untitled

a guest
Jan 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. class A {
  2. public int aaa() { return 1; }
  3. }
  4.  
  5. class B {
  6. A classA;
  7.  
  8. B(A classA) { this.classA = classA; }
  9.  
  10. public int getAAA() { return classA.aaa(); }
  11. }
  12.  
  13. A spyA = mock(A.class);
  14. when(spyA.aaa()).thenReturn(10);
  15.  
  16. A AA = new A();
  17. int res = new B(AA).getAAA();
  18. Logxx.d("RESULT: " + res);
Add Comment
Please, Sign In to add comment