I'm wondering if I'm doing something wrong. I have a java class this is something like this
class MyClass {
private Integer accessLevel;
AccessLevel getAccessLevel() {
return AccessLevel.getEnum(accessLevel);
}
}
Then I have a mock like this
every { mock.getAccessLevel() } returns AccessLevel.SomeAccessLevel
However, when I try to do that, it says
Can not set java.lang.Integer field accessLevel to AccessLevel
Is there something I should know about this? If I rename the integer it will work, but I don't think that's a solution because that field has been serialized and stored so if I want to deserialize it on newer versions of my app then it will fail.