I have an enum switch more or less like this:
public static enum MyEnum {A, B} public int foo(MyEnum value) { switch(value) { case(A):
jMock (at least as of version 2.5.1 that I'm using) can do this out of the box. You will need to set your Mockery to use ClassImposterizer.
Mockery mockery = new Mockery(); mockery.setImposterizer(ClassImposterizer.INSTANCE); MyEnum unexpectedValue = mockery.mock(MyEnum.class);