File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Original Void Method is called when using Mockito.doNothing

gayathri murugesan
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am new to JUnit Testing.I have a void DB call which i need to mock.

In the method i need to test,

I have

DBTester db = new DBTester();

DBTester mockobj = Mockito.mock(DBTester.class);
Mockito.doNothing().when(mockObj).method((BigInteger)Mockito.anyObject(), (BigInteger)Mockito.anyObject(), (obj)Mockito.anyObject());

In have added in the annotation


But it hits the original DB Call.Can someone please throw light on where i am going wrong

Thanks in advance

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic