• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

How to EasyMock a void method

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm new to EasyMock Java API, I'm trying to figure out the way to mock void methods ,I have a Wrapper class which is calling dao helper class void method.I'm trying to mock the dao void method

I have written a Java Unit class to test the Wrapper doProcess Method, I have mocked the Dao instance in the WrapperTest.java class Since the dao delete method is void which i cant able to add EasyMock.Except() method since it only takes method which has return types.

For Example:


Wrapper.java

void doProcess(){

pedingRequestDao.deleteRequests(List);
}

My question Is there a way to mock the dao void method ?Please help I'm getting the below exception

java.lang.AssertionError
Unexcepted method call dao.deleteRequest([12345.2345]);
 
reply
    Bookmark Topic Watch Topic
  • New Topic