I'm using junit and EasyMock to do unit testing on a project I'm working on. However, I've run into a problem. I have a good handful of methods that have a parameter that is an enumeration.
I ran into the java.lang.NullPointerException when attempting to mock the enum, and it seems enums just cannot be mocked. More information I found on it here:
http://download.oracle.com/javase/tutorial/java/javaOO/classvars.html
Is there any good way to unit test this method without mocking the enum??
Thanks!
EDIT: Péter Török was right! I was completely looking over the fact that I could just plug in something for the enum. For example:
public void methodName(String description, Location buildingLocation) {
where Location is my enum, I can call the method as:
methodName("here is my description", Location.DENVER);