When I\'m testing this static method
public class SomeClass {
public static long someMethod(Map map, String string, Long l, Log log) {
...
}
Try replacing the isA() to another any() call like this
Mockito.when(SomeClass.someMethod(anyMap(), anyString(), anyLong(), any(Log.class))).thenReturn(1L);
[EDIT]
Check your stacktrace when you get the exception. Are you seeing any NoClassDefFoundError
reported? I noticed when I hadn't included the javassist.jar
in my project I got a similar error to you.
I use PowerMockito and these are the jars I added to a brand new project to run the code that @Tom posted
Always a good idea to check that you're using compatible JAR versions, and also check if there are any other conflicting JARs in your projects classpath.