I use junit and EasyMock to unit test the project I'm working on. However, I ran into a problem. I have a good handful of methods that have a parameter that is an enumeration.
I came across java.lang.NullPointerException while trying to mock an enumeration, and it seems that the enumerations simply cannot be taunted. More information I found here:
http://download.oracle.com/javase/tutorial/java/javaOO/classvars.html
Is there any good way to unit test this method without bullying enum ??
Thanks!
EDITOR: Peter Torek was right! I thoroughly studied the fact that I could just plug in something for listing. For instance:
public void methodName (string description, Location buildingLocation) {
where Location is my listing, I can call the method like:
methodName ("here is my description", Location.DENVER);
source share