Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Junit, Jmock test: how to test a void method

 
Mi Na Mi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'd like to ask a question, how can I test a void method.

For example smth like this
Class A{

void method(){
...
some objects, which state can be changed.
...
}
}


I mock some objects, but I have no idea how to test a method which does not return anything....
Thank you
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the method throws an Exception?

Does the method change the stated of an object (that goes as parameter)?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic