Guest User

Untitled

a guest
Apr 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public class Enclosing {
  2.  
  3. public String methodA() {
  4. getContext();
  5. ......
  6. }
  7.  
  8. protected void getContext() {
  9. Inner.getContext();
  10. ......
  11. }
  12.  
  13. @Test
  14. public void test_something() {
  15. Enclosing enclosing = new Enclosing() {
  16. @Override
  17. protected void getContext() {
  18. // do what you need here
  19. }
  20. };
  21.  
  22. // your test code on enclosing where you control getContext
  23. }
Add Comment
Please, Sign In to add comment