User Profile

Collapse

Profile Sidebar

Collapse
intelrate
intelrate
Last Activity: Sep 26 '09, 09:04 AM
Joined: Jun 11 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • intelrate
    replied to How to mock protected method in Java
    in Java
    Actually I'm not totally happy with the solution I have but for now it should be fine.

    Thanks....
    See more | Go to post

    Leave a comment:


  • intelrate
    replied to How to mock protected method in Java
    in Java
    Thank you JosAH

    That's what I'm doing right now. The problem is that if my protected method has 2 arguments then my mock method should be like

    Object mockMethod(Obje ct parameter1, Object parameter2);

    If I need to mock another protected method with 3 parameters then I have to create

    Object mockMethod(Obje ct parameter1, Object parameter2, Object parameter3);

    It works for...
    See more | Go to post

    Leave a comment:


  • intelrate
    started a topic How to mock protected method in Java
    in Java

    How to mock protected method in Java

    Here is a question.

    I wanted my JUnit tests to be more modular and found how to mock protected methods for that purpose. Briefly speaking, we cannot mock and control calls of protected method with JDK dynamic proxy because protected methods are not in any interface but we can create MockInterface with mock method under control and call it from overridden protected method to achieve our goal.

    The problem I’m trying...
    See more | Go to post
No activity results to display
Show More
Working...